tags:

views:

39

answers:

1

I'm trying to start an Activity with startActivityForResult, but I keep getting an ActivityNotFound exception, and I can't work out why. I've looked through the code multiple times, and it seems to be identical to some other, working code. Any suggestions?

The newNoteButton that starts the Activity:

    newNoteButton.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
            final Intent i = new Intent(Typy.this, TypyEdit.class);
            startActivityForResult(i, 1);
        }
    });

And the beginning of the TypyEdit Activity:

public class TypyEdit extends Activity {
private TextView mTitleText;
private TextView mBodyText;
private Long mRowId;
private NotesDbAdapter mDbHelper;

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
+2  A: 

You need to make sure the activity is included in the AndroidManifest.xml file like so

<activity android:name="TypyEdit" android:label="TypyEdit">
</activity>

Otherwise the activity will not be found.

slhck
Oh my god, I feel so stupid. Thanks a a lot!
Fraser
we have all done it at least once ;)
schwiz