Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP 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: 42968
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:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic