Questions tagged [up-navigation]

51 questions
27
votes
4 answers

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

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.…
hmuss
  • 301
  • 1
  • 3
  • 5
6
votes
1 answer

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

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 …
4
votes
2 answers

Android Navigation Component - OnNavigateUpListener

I would like to attach a callback to when the Android Navigation Controller navigates up from a specific fragment (findNavController().navigateUp()). How can I achieve this functionality? I've already heard about…
4
votes
2 answers

Up navigation with RecycleView

I'd like to ask your opinions about the ways to solve the problem with Android Up navigation that I'm trying to solve. I have an activity (MainActivity) with RecycleView, showing a scrollable list of items, being fetched from an API. Each item has…
Oleg
  • 107
  • 1
  • 7
4
votes
1 answer

Space between Up Navigation and Toolbar title is too large

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
Fernando Santos
  • 392
  • 4
  • 19
4
votes
1 answer

Deep linking and up navigation in Android

I have couple of questions regarding deep linking in conjunction with up navigation. In my application there is following hierarchy of activities: HomeActivity -> ItemListActivity -> ItemDetailActivity With deep linking (user clicks on a url…
Abdullah
  • 7,143
  • 6
  • 25
  • 41
4
votes
6 answers

android - refresh parent Activity when child Activity finishes

I have a parent Activity which starts a child activity. In the child activity, I do: toolbar = (Toolbar)…
Ofek Agmon
  • 5,040
  • 14
  • 57
  • 101
3
votes
2 answers

Building fragment stack for One Activity Many Fragment App

My App has only one activity and lots of fragments. In my activty's XML, I just have a FrameLayout on which I replace/add/hide/show various fragments. Imagine Fragment A is the first fragment the user sees when they open the app. Click something in…
rgv
  • 1,186
  • 1
  • 17
  • 39
3
votes
2 answers

Up Navigation and singleTop launch mode

I have an activity A, and when I press an toolbar item, it starts activity B using startActivity(intent). Whenever I press back button or the up navigation icon, it closes my app. I believe it's because I'm using launchMode="singleTop" in my parent…
3
votes
1 answer

onOptionsItemSelected not called pressing up navigation icon on fragment

Title is almost self explanatory. Architecture: I have Main activity that extends AppCompatActivity. Also I have a drawer layout. Each option of this menu opens a fragment. Each fragment has its own menu layout by setHasOptionsMenu(true) with its…
3
votes
2 answers

ANDROID: Simple Up Navigation Not Working

Up Navigation in Android is not working. All I want it to do is go back. However everytime I click the back button it closes the app. I followed android developer. My error log doesnt even say anthing useful so I have no idea why this is happening.…
anu
  • 703
  • 1
  • 10
  • 19
3
votes
3 answers

Up navigation animation

So I have followed the docs about Providing Up Navigation However, if I want to customize what the animation transitions look like in xml, I am trying to do something like this https://gist.github.com/lawloretienne/b8b4f68a779b9f97241f The enter…
Etienne Lawlor
  • 6,817
  • 18
  • 77
  • 89
3
votes
0 answers

Android navigation - Why do I need to call NavUtils.navigateUpFromSameTask(this)

I'm new to Android. I'm making action bar with Up navigation. I see the tutorial referring to "NavUtils.navigateUpFromSameTask(this)" call in onOptionsItemSelected. But I see I don't need this code. The default operation from Android is OK, it…
vietstone
  • 8,784
  • 16
  • 52
  • 79
2
votes
4 answers

Up navigation using backstack not working while clicked from notification

I am opening an activity from notification, which opens fine. However, I want to open it's parent activity while I click 'back button', currently it exits the application directly. I want it to navigate to HomeScreenActivity. Here is manifest…
Darpan
  • 5,623
  • 3
  • 48
  • 80
2
votes
1 answer

Android: Disappearing "up"-button at toolbar when opening fragment a second time

I created an android application with a navigation drawer. For this I used the android studio template Navigation Drawer Activity. To compine the appbar and navigation drawer it uses the ActionBarDrawerToggle class. Inside my activity I switch…
1
2 3 4