我正在使用包含4个标签的标签主机应用程序。每个选项卡都有单独的活动,列出项目。在每个选项卡的项目单击上转到另一个活动,显示相同选项卡主机屏幕布局中单击的列表项的详细信息。
如果在单击选项卡主机中的项目后按下后退按钮,则应用程序退出。但我需要访问以前到达的列表和选项卡。怎么做到这一点?在此先感谢
这是我的示例代码 -
ListAdapter adapter = new SimpleAdapter(this, mylist , R.layout.list,
new String[] { "title","shortdescription"},
new int[] { R.id.titleTextView,R.id.descriptionTextView});
ListView list = (ListView)findViewById(R.id.statutesListView);
list.setAdapter(adapter);
list.setOnItemClickListener(new OnItemClickListener()
{
public void onItemClick(AdapterView<?> parent, View view, int position, long id)
{
HashMap<String, String> hashMap = new HashMap<String, String>();
hashMap = (HashMap<String, String>) parent.getItemAtPosition(position);
String newstitle = hashMap.get("title");
String newsdesc = hashMap.get("shortdescription");
//Get the new Activity to tab.
Intent intent = new Intent(getApplicationContext(), detailedview.class);
Bundle bundle = new Bundle();
bundle.putString("title", newstitle);
bundle.putString("desc", newsdesc);
intent.putExtras(bundle);
View setview = getLocalActivityManager().startActivity("statutes", intent).getDecorView();
setContentView(setview);
}
});