I got ActivityNotFoundException error when i was trying to startup a new activity in android -
i trying start activity setup email account main activity. not working , driving me nuts. have is:
button.setonclicklistener(new view.onclicklistener() { public void onclick(view v) { edittext username = (edittext) findviewbyid(r.id.edittext1); edittext password = (edittext) findviewbyid(r.id.edittext2); componentname cname = new componentname("com.android.email", "com.android.email.activity.setup.accountsetupbasics"); intent intent = new intent("android.intent.action.main"); intent.putextra("com.android.email.accountsetupbasics.username", username.gettext().tostring()); intent.putextra("com.android.email.accountsetupbasics.password", password.gettext().tostring()); intent.putextra("com.android.email.extra.eas_flow", true); intent.setcomponent(cname); intent.setflags(intent.flag_activity_new_task); context.startactivity(intent); } });
manifest is:
<application android:allowbackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/apptheme" > <activity android:name="com.example.test.mainactivity" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.main" /> <category android:name="android.intent.category.launcher" /> </intent-filter> </activity> </application>
and error:
android.content.activitynotfoundexception: unable find explicit activity class {com.android.email/com.android.email.activity.setup.accountsetupbasics}; have declared activity in androidmanifest.xml?
i'm new this, can tell me how solve error?
any response appreciated.
you can start other's activity if exported. check if com.android.email.activity.setup.accountsetupbasics
is. , should try/catch
startactivity()
can throw exception more reasons , if let go uncaught, app crash
Comments
Post a Comment