I have write 2 app, A_app and B_app.
In A_app, I want to call B_app and launch B_app's CalledActivity.
But the B_app's MAINActivity is MainActiity not CalledActivity.
In A_app, I try below code to call B_app:
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.setComponent(new ComponentName("com.example.bapp","com.example.bapp.BActivity"));
intent.putExtra ("test2abc", "abctest2");
startActivity(intent);
And in B_app's BActivity has code in onCreate as below:
Bundle params = getIntent().getExtras();
if (params != null) {
String temp = params.getString ("test2abc");
Toast.makeText (BActivity.this, temp, Toast.LENGTH_LONG).show();
}
But there are some error as below:
01-10 10:47:16.904: E/AndroidRuntime(8355): java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cmp=com.example.bapp/.BActivity (has extras) } from ProcessRecord{418a3788 8355:com.dlink.nas/u0a7} (pid=8355, uid=10007) not exported from uid 10115
I want the B_app is only called directly by A_app without other call it.
How can I fixed it?