B770
B770

Reputation: 1292

Android: open other application within tabhost via intent. Don't open new view in fullscrreen

I've got a tab layout in my app. My last tab is only needed to display an other app that is installed on my tablet. This app isn't mine. I've installed it from the market. At the moment I can touch on the tab and the other app opens in a new page/view in fullscreen. But I don't want to leave my app. The app should be nestet in my app so that I the othe app is running under the tab bar of my app.

Code that opens other app via intent:

public class MyActivity extends Activity{

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

    Intent i = getPackageManager().getLaunchIntentForPackage("org.kman.WifiManager");
    startActivity(i);
    }
} 

the part of tab layout:

spec = tabHost.newTabSpec("mytab").setIndicator("MyTab",
            res.getDrawable(R.drawable.address_book_new))
                    .setContent(new Intent(this, MyActivity.class));
    tabHost.addTab(spec);

Any hints how to display the app in the tab host?

Thx B770

Upvotes: 0

Views: 395

Answers (1)

Kris Van Bael
Kris Van Bael

Reputation: 2862

Even if the other app is launched, the user is not ’leaving' your app. That's the whole point of the activity stack and the back button. The user knows your app is just a back button away.

I don't think it is possible what you ask. I wouldn't like it as a user. The other app developer would not have anticipated a non-full-screen layout. For the OS it creates all sorts of event handling challenges too.

Upvotes: 1

Related Questions