我正在制作包含三个选项卡的 android 应用程序。在第三个选项卡上有登录屏幕。
当我点击登录按钮时......我想用包含列表视图和注销按钮的活动替换活动......
以前我使用活动组来替换活动..但是活动组现在已弃用..
现在如何替换第三个选项卡下的活动?
我正在使用这些代码
Intent intent = new Intent(MyApp.this, LoginPage.class);
replaceContentVieww("activity4", intent);
public void replaceContentVieww(String id, Intent newIntent) {
// TODO Auto-generated method stub
View view = getLocalActivityManager().startActivity(id,newIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)).getDecorView();
setContentView(view);
}
有一个链接,我知道这个类已被弃用。