1 <#if parentActivityClass != ""> 2 3 @Override 4 public boolean onOptionsItemSelected(MenuItem item) { 5 switch (item.getItemId()) { 6 case android.R.id.home: 7 // This ID represents the Home or Up button. In the case of this 8 // activity, the Up button is shown. Use NavUtils to allow users 9 // to navigate up one level in the application structure. For 10 // more details, see the Navigation pattern on Android Design: 11 // 12 // http://developer.android.com/design/patterns/navigation.html#up-vs-back 13 // 14 NavUtils.navigateUpFromSameTask(this); 15 return true; 16 } 17 return super.onOptionsItemSelected(item); 18 } 19 </#if> 20