Following Android drag and drop example, error "btn_default_pressed cannot be resolved or is not a field" - android-layout

Working in min API 15, I'm trying to find how I can drag and drop one item element out of a ListView list onto a TextView above it (just to copy the text into it).
I'm trying to follow this example:
http://techdroid.kbeanie.com/2011/10/drag-and-drop-honeycombics.html
Namely these two parts...
http://code.google.com/p/myandroidwidgets/source/browse/trunk/HCDragDrop/src/com/beanie/hcsample/dragdrop/MyDragShadowBuilder.java
http://code.google.com/p/myandroidwidgets/source/browse/trunk/HCDragDrop/src/com/beanie/hcsample/dragdrop/HCDragDropActivity.java
However, I can't figure out how to fix this error
The import android.view.View.DragShadowBuilder cannot be resolved
Or if I remove the import then DragShadowBuilder gives me
DragShadowBuilder cannot be resolved to a type
I changed my minSDK And target SDK both to '15'. Should I not have access to these classes now? How can I resolve this error?
edit: I've fixed that problem- properties, android, set target. Clean, refresh. Ok.
But now I'm getting
btn_default_pressed cannot be resolved or is not a field
on
mShadow = v.getResources().getDrawable(R.drawable.btn_default_pressed);

Looks like that class came in API 11. So probably you have one of a couple problems.
You have set the SDK target in your manifest, but you haven't updated your actual SDK. If this is the case, go to the SDK Manager and get the necessary updates.
You project is still linked to a API 10 or lower jar. If this is the case go into, Project > Properties > Android and pick the correct library.
Project > Clean and restarting Eclipse can't hurt either.

Related

Problem: Visual C MFC Dialog editor “Failed to return new Code Element. Possibly syntax error. New Element Name test”

I have a simple MFC application, using Visual Studio 2019. My problem is that when I want to add a variable to any control I get the pop up message:
Failed to return new Code Element. Possibly syntax error. New Element Name test
To clarify: The problem is in the Visual C MFC Dialog Editor. Not in my code as it runs fine. I have tried all possible solutions that I found using Google. Nothing helps. The app is very simple. The only "extra" is that I am using tinyxml2.
What I found out by Google is that this is not a new problem, and the solution was to not use precompiled headers. And I am not using precompiled headers. so...
I am stuck. A long shot: Note the "Element" in the error text, and all the "elements" in tinyxml2. Some collision of symbols ??
I hint (maybe): I have got this message once before when I was using a long variable name. I shorted the name and the error was gone.
This is my second try. When the problem turned up I removed all changes since it was OK. But the problem is still there. Somthing I did has left some, not reversable, mark in the code (or database).

Editing component property values in the Properties tab seems to no longer work in ver 2.1.0

I recently upgraded to RedHawk V2.1.0, which has fixed several of the issues I had with previous versions, but one feature that I used seems to now not work. I have rebuilt and installed working components and waveforms. One of the components has a unsigned short property that is configured as readwrite and has an external id in the waveform. With v 2.0.1 I could launch and start the waveform and then view the properties in the properties tab at the bottom of the IDE window for the waveform or any component I clicked on and I could change a value in that window while the component was running or stop the component change it and restart. With version 2.1.0 I can still override the value when launching the waveform, but after launch the properties tab at the bottom displays the original default value (not the overridden value from launch) and it is not editable when the component is started or stopped. Was this changed intentionally or is this a bug? It seems to be true of all properties my components have. I have checked that these are still listed as readwrite in the prf file.
Or is there now a different way to change property values on the fly?
I should add that I am running in a domain, NOT the sandbox.
I think that I noticed this in the 2.0.5 IDE as well. For the time being, try just removing the "external" attribute from the PRF for that property and see what you get. I anticipate that this will be fixed in the next release of the 2.0.x and 2.1.x series.
Action type="external" in PRF or declaring in externalproperties in SAD does NOT affect ability to edit in the Properties panel, but I found that the checkbox for "Pass on command line" DID affect this. I am fairly certain that with v2.0.1 I was able to check pass on command line and still edit the value in the panel. With 2.1.0 checking it makes it NOT editable but without it checked I CAN edit. I am not sure if this change was intentional or not but at least I know how to work around it.

Cannot create class-file Android Studio

I'm trying to integrate Google Calendar API into my android project and I follow the tutorial here
https://developers.google.com/google-apps/calendar/quickstart/android
At step 5 create a new java class
I right click project folder src>main>java>com>example>utarapp and then new>file and entered the file name but then it has this error
What's going on ?
I'm using android studio 1.3.1
I think you are trying to create file with same name which is already present in the same package. This may be one possible reason.
It seems like you are right-clicking on the upper level in your application's directory tree.
Right click on one of the files inside the utarapp folder and then select Java class option from the menu.
For me this was happenning because of the length of the class name. In my case it was "ChallengesFragmentPagerAdapter"!
Changing it to "ChallengesPagerAdapter" solved the problem.
Create a blank Activity then remove "extends Activity" from the activity class.

Error opening nib in xcode: Error updating Objective-C type information. Multiple types...registered with the same Objective-C name: AppDelegate

Just getting started with xamarin studio and iOS development... I'm trying to set up my development projects. When setting all this up, I had initially created a project called 'MyProject.iOS'. I later decided that I didn't want the 'p' in MyProject to be capitalized. I deleted the existing project (using finder), removed it from my existing solution, and created a new one named 'Myproject.iOS'.
Now, when I try to open the Myproject_iOSViewController.xib file to edit in xCode, I get the following error:
Error updating Objective-C type information. Multiple types (MyProject.iOS.AppDelegate and Myproject.iOS.AppDelegate) registered with the same Objective-C name: AppDelegate
Seems like something is stuck in xCode from my original project that had the same name w/ different casing. I looked in Finder and confirmed that all the old files are gone.
I believe I am experiencing the same issue that was reported here (not sure why this issue is marked as resolved): https://bugzilla.xamarin.com/show_bug.cgi?id=7550
The last commenter has a great repo and reports this solution that worked for him:
1. Close XS
2. Delete ~/Library/Caches/XamarinStudio-4.0 folder
3. Open XS : voilà everything works again now !
My issue at this point is that I cannot find the ~/Library/Caches/XamarinStudio-4.0 to delete. I found a ~Library/Caches/ folder but it did not have a XamarinStudio-4.0 sub-folder in there. How can I resolve this?
I am using 4.0.9 (Build 12) of Xamarin studio.
Here is the full stack trace from the error message box that shows up when I double click the xib file:
System.ArgumentException: Multiple types (MyProject.iOS.AppDelegate and Myproject.iOS.AppDelegate) registered with the same Objective-C name: AppDelegate
at MonoDevelop.MacDev.ObjCIntegration.NSObjectProjectInfo.Update () [0x00118] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-4.0.9-branch/f9c5c24e/source/md-addins/MonoDevelop.MacDev/MonoDevelop.MacDev/ObjCIntegration/NSObjectProjectInfo.cs:98
at MonoDevelop.MacDev.ObjCIntegration.NSObjectProjectInfo.Update (Boolean force) [0x0000c] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-4.0.9-branch/f9c5c24e/source/md-addins/MonoDevelop.MacDev/MonoDevelop.MacDev/ObjCIntegration/NSObjectProjectInfo.cs:72
at MonoDevelop.MacDev.XcodeSyncing.XcodeProjectTracker.UpdateTypes (IProgressMonitor monitor) [0x0003c] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-4.0.9-branch/f9c5c24e/source/md-addins/MonoDevelop.MacDev/MonoDevelop.MacDev/XcodeSyncing/XcodeProjectTracker.cs:476
I just had this problem. I used that post to solve it. At first I could not find the folder that is referenced. This is how I found it.
Go into finder on the Mac.
Under Favorites on the left of the screen, select the primary volume. For me that was labeled Macintosh HD.
Select Go/Go to Folder from the toolbar.
In the Go to the Folder screen that pops up type in ~/Library.
From there you can navigate to the proper directory and delete it.
Hope that helps. Best of luck.

unable to edit R.java Android using Eclipse

I am new to Android. Well the problem I am facing is that I have two layouts. One is main.xml and another that I made was relative_layout.xml.
I did not give it an #+id/ to this layout so the default id was relative_layout01.xml but when I gave this an id the old one still remain in my R.java and when I edit R.java it again generated the old version of file.
I want to delete relative_layout01.xml reference as it does not exists as I have given a name to my layout.
Attaching an image for reference.
R.java should be refreshed automatically.
Maybe you still have some references to it in your code (setContentView(R.relative...) or you still have it as an activity in AndroidManifest.xml?
Sorry for the noobish answer. Just my 2 cents..
Delete import android.R, and R.java completely, rebuild and it would be fine

Resources