Android Programming Tutorials

(Romina) #1
A Fancier Form

NOTE: At this step, or any other, when you try to run your application, you


may get the following screen:


Figure 8. A "force-close" dialog

If you encounter this, first try to do a full rebuild of the project. In Eclipse,


this would involve doing Project > Force Clean. At the command line, use


ant clean or delete the contents of your bin/ and gen/ directories, then ant


install. If the problem persists after this, then there is a bug in your code


somewhere. You can use adb logcat, DDMS, or the DDMS perspective in


Eclipse to see the Java stack trace associated with this crash, to help you


perhaps diagnose what is going on.


Step #2: Add a RadioGroup..................................................................


Next, we should add some RadioButton widgets to indicate the type of


restaurant this is: one that offers take-out, one where we can sit down, or


one that is only a delivery service.


To do this, modify LunchList/res/layout/main.xml once again, this time to


look like:


21
Free download pdf