package xx.com.test;
import android.app.ActivityManager;
import android.app.LocalActivityManager;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.R.string;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.widget.TabHost;
import com.google.android.gms.appindexing.Action;
import com.google.android.gms.appindexing.AppIndex;
import com.google.android.gms.common.api.GoogleApiClient;
public class MainActivity extends AppCompatActivity {
private TabHost th;
private Intent soft;
private Intent money;
private Intent bill;
private Intent me;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
soft = new Intent(MainActivity.this, SoftyActivity.class);
money = new Intent(MainActivity.this, MoneyActivity.class);
bill = new Intent(MainActivity.this, BillActivity.class);
me = new Intent(MainActivity.this, MeActivity.class);
setContentView(R.layout.activity_main);
th = (TabHost) findViewById(R.id.tabHost);
th.setup();
th.addTab(buildTagSpec("tab_soft",
R.string.soft, R.drawable.shezhi, soft));
th.addTab(buildTagSpec("tab_money",
R.string.money, R.drawable.shezhi, money));
th.addTab(buildTagSpec("tab_bill",
R.string.bill, R.drawable.shezhi, bill));
th.addTab(buildTagSpec("tab_me",
R.string.me, R.drawable.shezhi, me));
}
private TabHost.TabSpec buildTagSpec(String tagName, int tagLable,
int icon, Intent content) {
return th.newTabSpec(tagName)
.setIndicator(getResources().getString(tagLable),
getResources().getDrawable(icon, null)).setContent(content);
}
}
其實是這樣的,tabhost 加載intent 就是要用localactivitymanager 搞一下。但是這個包已經棄用了....
搞球不明白