我正在使用包含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);
}
});
你不能这样做:View setview = getLocalActivityManager()。startActivity(“statutes”,intent).getDecorView(); setContentView(setview); – 2012-01-28 09:59:00
是的,它的工作,但它会完成我的应用程序,当我按回来按钮 – Praveenkumar 2012-01-28 10:27:13