Code example for ActionBarActivity

Methods: finish

0
 
    @Override 
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
            case android.R.id.home:
                finish(); 
                return true; 
            default: 
                return false; 
        } 
    } 
 
    @Override 
    public void onItemClick(AdapterView<?> adapterView, View view, int position, long l) {
        String selection = listAdapter.getItem(position);
        Intent launchIntent = new Intent(this, MiroGuideCategoryActivity.class);
        launchIntent.putExtra(MiroGuideCategoryActivity.EXTRA_CATEGORY,
                selection);
        startActivity(launchIntent);
    } 
}