android的activitygroup使用
2015-07-17 14:25
507 查看
使用方法:
让mainactivity继承ActivityGroupmanager = getLocalActivityManager(); private void showPage(Class<?> cls) { container.removeAllViews(); manager.removeAllActivities(); System.gc(); container.addView(manager.startActivity(cls.getName(), new Intent(context, cls).addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)).getDecorView()); }
addView便可以给mainactivity的container(是一个空白的viewgroup)添加view,实际上他是一个activity,还是要配置在AndroidManifest.xml里面。
相关文章推荐
- AndroidStudio项目发布到GitHub
- Android中selector背景选择器
- Android Studio中使用android:src="@drawable/ic_launcher"报错
- 手势
- Android 带清除 和 晃动效果的 自定义 EditText 解析
- Android开发中应该注意的事项
- 背景音乐(安卓Service)
- Android中的序列化浅析
- andriod studio 打包
- Android 中控件RecyclerView详解及实现瀑布流式布局
- Android自定义控件
- android CheckBox和右侧文字间距问题
- android textview 笔记
- Android中自定义弹窗提醒控件
- Android 手把手教您自定义ViewGroup(一)
- android:installLocation
- android Fragmentd的使用
- android intent隐式调用之一个应用程序启动另一个应用程序
- Android studio 混淆代码
- Android中Listview(五)--拖拽listview