up-navigation

What is the ID of the back arrow drawable in the ActionBar?

馋奶兔 提交于 2019-12-22 04:59:32
问题 The following code causes a back arrow to appear in the ActionBar: getSupportActionBar().setDisplayShowHomeEnabled(true); getSupportActionBar().setDisplayHomeAsUpEnabled(true); I'm looking for the resource ID of the arrow drawable, i.e. android.R.drawable.xxx. The reason I need this ID is so that I can manually set an identical arrow (size & colour) elsewhere in my app. I tried making my own drawable and using that but the size was different from the one in the ActionBar. 回答1: If you have the

android - refresh parent Activity when child Activity finishes

邮差的信 提交于 2019-12-12 19:17:28
问题 I have a parent Activity which starts a child activity. In the child activity, I do: toolbar = (Toolbar) findViewById(R.id.app_bar); setSupportActionBar(toolbar); getSupportActionBar().setTitle("Ride"); getSupportActionBar().setDisplayHomeAsUpEnabled(true); When I click the Home/Up button, I finish the activity. @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: finish(); return true; default: return super.onOptionsItemSelected

Space between Up Navigation and Toolbar title is too large [duplicate]

跟風遠走 提交于 2019-12-10 15:55:22
问题 This question already has answers here : Padding / space in Toolbar between icon and title (Android 24) (2 answers) Closed last year . Does anyone knows why is it happening? The first one is how it's look like and the second one is how I want it to look like OBS: When I enable the app icon in the toolbar, it almost has no space between it and the title 回答1: Yeah, that happening with everyone using v24.0.0 and above support library version. Toolbar title has an extra 16dp padding since version

What is the ID of the back arrow drawable in the ActionBar?

試著忘記壹切 提交于 2019-12-05 05:34:41
The following code causes a back arrow to appear in the ActionBar: getSupportActionBar().setDisplayShowHomeEnabled(true); getSupportActionBar().setDisplayHomeAsUpEnabled(true); I'm looking for the resource ID of the arrow drawable, i.e. android.R.drawable.xxx. The reason I need this ID is so that I can manually set an identical arrow (size & colour) elsewhere in my app. I tried making my own drawable and using that but the size was different from the one in the ActionBar. If you have the support library in your project, you can make a back button in any place in your applicaction like this:

How do I set the parent activity of an activity at runtime?

南笙酒味 提交于 2019-12-04 03:42:44
问题 I have an arbitrary number of hierarchically nested views/activities. The action bar should show the Up navigation button to navigate to a higher level in any view. For this, the google documentation says I have to set the parent activity with a tag in the activity's xml definition. However, I'm creating my activities dynamically and a child element can be of the same activity as it's parent. So how do I set the parent activity to the actual parent instance at runtime? 回答1: It sounds like you

How do I set the parent activity of an activity at runtime?

我的梦境 提交于 2019-12-01 18:17:55
I have an arbitrary number of hierarchically nested views/activities. The action bar should show the Up navigation button to navigate to a higher level in any view. For this, the google documentation says I have to set the parent activity with a tag in the activity's xml definition. However, I'm creating my activities dynamically and a child element can be of the same activity as it's parent. So how do I set the parent activity to the actual parent instance at runtime? It sounds like you are confusing up and back navigation. The up button should be deterministic. From a given screen, the up