Thursday, April 7, 2011

INTERCEPTING ONE APP FROM ANOTHER IN ANDROID

hi, if u want to open one application from another using intent the following code is usuful.

Intent intent = new Intent(Intent.ACTION_MAIN);

intent.setComponent(new ComponentName("com.example.android.apis","com.example.android.apis.ApiDemos")); //Here we have to specify package name and corresponding activity in that package are parameters.

startActivity(intent);

      In this example i am opening api demos from my application. So "com.example.android.apis" is the main package and "com.example.android.apis.ApiDemos" is the main activity.

No comments:

Post a Comment