0

I have an activity that I would like the "up affordance" on.

public class ItemListActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        ActionBar actionBar = getSupportActionBar();

        actionBar.setDisplayHomeAsUpEnabled(true);

        // ...
    }
}

This adds the "back button" like I want. The problem is that the Title is not considered part of the back button in this instance. Is there any way to make it so that it behaves more like the Messaging app? In the Messaging app you can tap either the back button or the title and it will take you back to the previous activity.

Dismissile
  • 32,564
  • 38
  • 174
  • 263
  • You could add a listener to your ActionBar title, check this question http://stackoverflow.com/questions/24838155/set-onclick-listener-on-action-bar-title-in-android – Gueorgui Obregon Feb 23 '16 at 21:39

1 Answers1

0

Add an onClickListener to the title of your ActionBar. See this post for example: Set OnClick Listener on Action Bar Title in Android

Community
  • 1
  • 1
  • This isn't quite what I'm looking for. If you look at the messaging app the Title/Subtitle are somehow combined with the up button. If you hold the title button you will see the "ripple effect" and it spreads across the title and the up button like they are the same view somehow. Pressing the title seems to activate the up button and vise versa. – Dismissile Feb 24 '16 at 14:12