的ActivityGroup是德precated [英] ActivityGroup is Deprecated
问题描述
我想提出包含三个选项卡android应用..在第三个选项卡有密码的屏幕。
I am making android application containing three tabs.. On third tab there is login screen..
当我点击登录按钮...我想替换包含与活动活动列表视图和注销按钮......
when i click on login button ...i want to replace the activity with activity containing list view and logout button....
previously我使用活动组,以取代activity..But活动集团现在是很precated ..
Previously i was using Activity Group to replace the activity..But activity Group is now deprecated..
现在我怎么能代替在第三个选项卡的活动??
Now how can i replace the activity under third tab??
我使用这些code
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);
}
有链接的,我才知道这类已经去precated。
推荐答案
你应该使用片段和FragmentManager的兼容包
you should use Fragment and FragmentManager in the Compatibility Package
http://developer.android.com/sdk/compatibility-library.html
使用ADT下载它,然后去样品这里 演员/安卓/兼容性/ V4 /样本/
download it using the ADT, then go to the samples here extras/android/compatibility/v4/samples/
这篇关于的ActivityGroup是德precated的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!