android open PackageManager as a dialog

Go To StackoverFlow.com

1

Hi I am opening another app from my app. I want to display that another app in a dialog box. So what are my options. I an trying the code below...

public class PictureGallery extends Activity{

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    PackageManager pm = getPackageManager();
    Intent intent = pm.getLaunchIntentForPackage("com.abc.me");
    startActivity(intent); ???
    setContentView(intent); ????
   }
}

I am setting theme for that activity as a dialog. So how do I set setContentView as it's not a layout but diff. activity ?

Appreciate your help.

2012-04-04 18:33
by user1143989
The Android system doesn't work this way. You cannot launch another application within your own "frame" If the activity you are attempting to launch was not created as a dialog there is no way (on stock android) for you to force the system to display it in a dialog (or any other "frame" type thing within your own application - FoamyGuy 2012-04-04 18:40


1

I am opening another app from my app. I want to display that another app in a dialog box.

You simply cannot do this, sorry.

2012-04-04 18:41
by slayton
Ads