On Thu, Jul 15, 2010 at 8:31 PM, Raul Martinez <[email protected]> wrote:
> mark for some reason i keep getting a force close, any idea why, maybe i
> dont get the concepts of activitys and class i have this as my first
> activity
:: snip ::
> public class home extends Activity {
> /** Called when the activity is first created. */
> �...@override
> public void onCreate(Bundle icicle) {
> super.onCreate(icicle);
> setContentView(R.layout.main);
>
> Button word = (Button) findViewById(R.id.word);
> word.setOnClickListener(new Button.OnClickListener(){
> public void onClick(View v){
> Intent intent = new Intent(null,Category.class);
You cannot have a null Context when creating an Intent like this. Use
"home.this" (minus the quotes) to reference your Activity -- this is
why I supplied you with the following link earlier in this thread:
http://en.wikibooks.org/wiki/Java_Programming/Nested_Classes
In the future, use adb logcat, DDMS, or the DDMS perspective in
Eclipse to examine the Java stack trace associated with your "force
close".
--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy
_The Busy Coder's Guide to Android Development_ Version 3.1 Available!
--
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en