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

package com.office.mate;

import com.office.mate.R;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

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);
         startActivity(intent);

         }
        });
        }

    }

and i want it to open this one:

package com.office.mate;

import com.office.mate.R;
import android.app.Activity;
import android.os.Bundle;

public class Category extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle icicle) {
        super.onCreate(icicle);
        setContentView(R.layout.category);
    }
}

am i doing this right or am i doing it wrong

On Thu, Jul 15, 2010 at 6:02 PM, Mark Murphy <[email protected]>wrote:

> On Thu, Jul 15, 2010 at 6:57 PM, Raul Martinez <[email protected]> wrote:
> > Ok thanks but what do I use instead of MAIN
>
> You do not need an <intent-filter> if you are starting the activity
> via the class (Category.class) in your Intent.
>
> --
> 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]<android-beginners%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/android-beginners?hl=en
>

-- 
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

Reply via email to