localTextView.setOnClickListener(new OnClickListener(){
public void onClick(View arg0) {
Log.d(TAG, "news more Clicked");
startNewsListctivity();
}
});
}
private void startNewsDetailActivity(int position){
Intent i_newsdetail = new Intent(HomeActivity.this, NewsDetailActivity.class);
i_newsdetail.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
//获取news_id
int news_id = mNewsData_act.get(position).getNewsId();
Bundle data = new Bundle();
data.putInt("news_id", news_id);
i_newsdetail.putExtras(data);
// 将Activity转换成view
Window window = HomeActivityGroup
.getInstance()
.getLocalActivityManager()
.startActivity(NewsDetailActivity.class.getSimpleName(),
i_newsdetail);
View view = window.getDecorView();
HomeActivityGroup.getInstance().setContentView(view);
}
private void startNewsListctivity(){
Intent i_newslist = new Intent(HomeActivity.this, NewsListActivity.class);
i_newslist.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
// 将Activity转换成view
Window window = HomeActivityGroup
.getInstance()
.getLocalActivityManager()
.startActivity(NewsListActivity.class.getSimpleName(),
i_newslist);
View view = window.getDecorView();
HomeActivityGroup.getInstance().setContentView(view);
}