Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
Jonathan Wallace
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?
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • 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:
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!