[android-developers] Solving Missing R
I have gotten various kinds of advice for solving Missing R. I'm trying to organize that into a checklist to work through the problem efficiently. - Any comments on the efficacy of these steps? - Any additional techniques? - Any change in order? Thanks. Solving Missing R error 1. Find and fix the problem in the XML file 2. Check file names in /res/ have proper characters: a-z0-9_ 3. Save all open files 4. Clean project 5. Refresh project 6. Build Project (if that choice is available in menu) 7. Delete existing R and build 8. Close Eclipse and re-open 9. Turn off Auto build 10. Re-install SDK -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Theory: how to choose among button press techniques?
I’ve observed two ways to handle a button press: #1 and #2 below. - Can anyone explain the situations where I should use one or another? - What is the proper terminology to describe the two techniques? - Are there more ways to handle a button press? Much thanks. 1. Set event handler in Main.xml 1.1.Main.xml: 1.1.1. Button 1.1.1.1.android:id=@+id/buttonMine… 1.1.1.2.android:onClick=runMyCode 1.2.X.Java 1.2.1. public void changeToRed(View v) { 1.2.2. tvResult.setText(Red); 2. Set event handler in .java 2.1.Main.xml: 2.1.1. Button 2.1.1.1.android:id=@+id/buttonMine… 2.2.X.java: 2.2.1. Public class… implements OnClickListener… 2.2.1.1.Button btnMyButtonInCode; // used for code ref to object 2.2.2. Public onCreate 2.2.2.1.btnMyButtonInCode =(Button)findViewById(R.id.buttonMine); 2.2.2.2.btnMyButtonInCode.setOnClickListener(this); 2.2.3. public void onClick(View v)… 2.2.3.1.(code to run when button pressed) -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Eclipse: Switch between devices for testing
I have several AVDs and one external phone (usb). I want to run apps on all for testing. I can't find in Eclipse where to set the device to use for a given run. The first time I run an app it asks. But now I want to change. I see Run/Configure but that seems to only be for the target version, not the device. Thanks. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Eclipse: Switch between devices for testing
Perfect, much thanks. I wish I could put back that hair I pulled out over that problem. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Eclipse: Switch between devices for testing
Worked perfect. Thank you much. On Feb 2, 4:53 pm, Harri Smått har...@gmail.com wrote: -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Test apps with usb to phone - works if phone has bad ESN?
So far I've been testing apps during dev using emulator. I understand I can test directly on an android phone attached by USB. I'd like to try. In order to get a few cheap phones for testing I am looking at used units with bad ESN. Will they work for testing by USB to my development PC? They won't be on any service plan and, of course, only testing apps that run with no connection to a service. Thanks. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Confused about error for (Button)findViewById(R.id.MyButton)
I don't understand the findViewById(R.id.myWidget) syntax. I've searched for an explanation and only found more advanced topics. In graphic layout of main.xml I add a button and edit ID to @+id/ myButton and edit text to a new string. I assume that somewhere an ID is recorded, similar to strings.xml that holds the strings. But in the .java file when I do this: Button myButton = (Button)findViewById(R.id.myButton); the id shows an error (red squiggle). Is my concept of storage of IDs wrong? Where are ID's stored? (Or is this beyond what a beginner should be thinking about?) How can I get the id in above line of code to recognize the collection of IDs? Much thanks. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Write Hello World run - great. Change string and can't see result
Eclipse + Android Add-in + Emulator: First tried Hello World worked perfect - a real thrill. Then back to Eclipse and changed string to Hello World 2 Clicked through Run As / Android Application I can't seem to get edited code to the emulator. How to re-load emulator with a modification, particularly during development where I have to do frequently? Much thanks. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en