ITeye博客

ActivityGroup 内的activity 启动另一个activity方法

jguangyou · 2012-04-26 19:04 · android · 移动开发 · Markdown


RelativeLayout rl = (RelativeLayout) this.getParent().getWindow()
				.findViewById(R.id.datacontainer);
		rl.removeAllViews();
		Intent intent = new Intent(this, NewsDetailsActivity.class);
		intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
		Window sub = ((ActivityGroup) this.getParent())
				.getLocalActivityManager().startActivity("NewsDetailsActivity",
						intent);
		View v = sub.getDecorView();
		LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
				LinearLayout.LayoutParams.FILL_PARENT,
				LinearLayout.LayoutParams.FILL_PARENT);
		v.setLayoutParams(params);
		rl.addView(v);

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。