Win a copy of Machine Learning Systems: Designs that scale this week in the Scala forum
or Xamarin in Action: Creating native cross-platform mobile apps in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How do I set the activity of the "Up-button" programatically?  RSS feed

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Edit: Eh nevermind, seems the only problem was I was trying to use the *support* version: getSupportParentActivityIntent. Remove "support" and it works fine.


I need to be able to control dynamically to which activity the user goes "back", when they press the "Up" button.

It can be set statically in the manifest as follows:

It appears it is can be set programatically following the description here, but I can't seem to figure out how it works. Help anyone?
 
Rancher
Posts: 42975
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Edit: Eh nevermind, seems the only problem was I was trying to use the *support* version: getSupportParentActivityIntent. Remove "support" and it works fine.

I need to be able to control dynamically to which activity the user goes "back", when they press the "Up" button.

It can be set statically in the manifest as follows:

It appears it is can be set programatically following the description here, but I can't seem to figure out how it works. Help anyone?


You could implement something even more dynamic by handling the back button directly:
 
Did Steve tell you that? Fuh - Steve. Just look at this tiny ad:
free 1 hour java lesson
https://coderanch.com/t/695988/free-hour-java-lesson
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!