To debug multiple task stacks today, invoke the activity of another program in the test program,
The code snippet is as follows:
[Java]View Plaincopy
- btnstartx= (Button) Findviewbyid (R.ID.BTNSTARTX);
- Btnstartx.setonclicklistener (new View.onclicklistener () {
- @Override
- Public void OnClick (View v) {
- //TODO auto-generated method stub
- Intent myintent = new Intent ();
- Myintent.addflags (Intent.flag_activity_new_task);
- Myintent.setclassname ("Com.linc.TestBackStackXYZ",
- "Com.linc.TestBackStackXYZ.ActivityX" );
- StartActivity (myintent);
- }
- );
Result Error:
from:http://blog.csdn.net/lincyang/article/details/6801381
[HTML]View Plaincopy
- java.lang.SecurityException:Permission denial:starting Intent { flg=0x10000000 cmp=com. Linc. testbackstackxyz/. Activityx} from Processrecord{406f5a18 370:com.linc.testbackstack/10042} (pid=370 , uid=10042) requires null
Began to think is the reason for permission, looked up again permission no results. Later, because Activityx did not join the action in the Manifast file definition, the following definition would be fine:
[HTML]View Plaincopy
- < Activity android:name="activityx" android:label=" Activityx ">
- < Intent-filter >
- < Action android:name="Android.intent.action.MAIN" />
- </ Intent-filter >
- </ Activity >