【发布时间】:2012-04-23 22:12:35
【问题描述】:
我有一个带有列表视图的活动。当用户单击项目时,项目“查看器”打开:
List1.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,long arg3) {
Intent nextScreen = new Intent(context,ServicesViewActivity.class);
String[] Service = (String[])List1.getItemAtPosition(arg2);
//Sending data to another Activity
nextScreen.putExtra("data", datainfo);
startActivityForResult(nextScreen,0);
overridePendingTransition(R.anim.right_enter, R.anim.left_exit);
}
});
这很好用,但在操作栏上,应用图标旁边的后退箭头没有被激活。我错过了什么吗?
【问题讨论】:
-
getActionBar().setDisplayHomeAsUpEnabled(true);在 onCreate 和switch (item.getItemId()) {case android.R.id.home: onBackPressed();break;}在onOptionsItemSelected?都在 ServicesViewActivity -
为什么不作为答案搁置?
标签: java android android-3.0-honeycomb