Tobias Eisentraeger wrote:
> Hello Mark,
>
> thanks for looking into that with me.
>
> The problem is the Button Object which does not
> get instantiated correctly, i guess this is what null is. i can let it
> crash now like this:
>
> theButtonBtn = (Button) findViewById(R.id.ButtonTheButton);
> Log.d("EditYourSettings","Before accessing ID");
> Log.d("EditYourSettings",""+theButtonBtn .getId()); // it crashed here
> - first access to the Button Object.
>
> Is there anything I do wrong getting the Button?
Most likely, either:
1. Your layout XML file does not contain a widget with
android:id="@+id/ButtonTheButton", or
2. You are calling findViewById() before calling setContentView() on the
activity
> How do you actually debug an android app with eclipse? Can you step
> through the code and check if a variable is null? Like on a normal java
> app? When i click on debug and set a breakpoint, it never stops. It just
> installs it on the device.
I don't use Eclipse, but you can debug with it, AFAIK. Unfortunately,
there is little documentation for it on the Android developer site.
--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy
_Android Programming Tutorials_ Version 1.0 In Print!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---