Take the 2-minute tour ×
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It's 100% free, no registration required.

When opening a URL in the official Android Twitter app it opens the native browser, showing the page for that URL. If I tap the back button in the browser (Galaxy S, 2.3.3, should it matter), one of two things happens:

  1. The browser goes back in its history opening the previous page/url it had opened.
  2. Android switches back to the Twitter app, back to the tweet with the URL I opened.

It eludes me what triggers either situation, it's seemingly random. I prefer option 2 when I'm reading my Twitter feed, can someone explain the logic behind this and perhaps even tell me how to make sure I trigger option 2 while reading my Twitter feed?

share|improve this question
    
One more tip: in case you re-used on of 4+ open tabs, create a (fake) new tab and press 'back'. That will also count as 'history' empty and will return you to the twitter app. Am I correct here? I use this trick with news&weather a lot. –  ce4 Jun 17 '12 at 21:59
add comment

1 Answer

up vote 6 down vote accepted

Your problem touches a feature of Android that sets it apart from other mobile OSes and is a very powerful one (see below):

That's all about intents, activities and the back stack that contains your path of visited activities in order for each app. Basically an activity is a single GUI fullscreen window you see, for example the main activity when you launch an app. If you navigate away from that, lets say to the settings view, the now inactive main view is put on the back stack and so forth.

However: This whole behaviour has many switches that are solely customizable by the app developers.

See this link for the basic information on those things:

http://developer.android.com/guide/topics/fundamentals/tasks-and-back-stack.html

Regarding your specific problem:

It might be a difference if the browser was (1) already open, (2) had an active Twitter tab running (that got reactivated) and so forth. Try some of these combinations (use 'force stop' in the app settings to end browser instances and have an/no open Twitter tab in the browser active beforehand), and you will find:

  • If you have opened the max of four windows in your browser, then opening an URL from the Twitter app will "re-use" one of them. If you hit back in that browser window it will first go all the way back up the history, one history item at a time. Once the history is empty, hitting the back button once more will send you back to the Twitter app.

  • If you had not opened the max of four windows in your browser, then opening an URL from the Twitter app will create a new browser window. If you hit back in that browser window the history for that window will already be empty, and you will directly go back to the Twitter app.

Some more information:

The unique system are Android's intents. New views are launched by an intent that, for example says 'open this file in a file view' or 'select a picture in a gallery viewer' or 'authenticate a my app with Facebook' and so forth. Without saying which other app should handle it. You see this when you get a choice menu asking you to select a specific browser (native/Chrome/Dolphin/Opera) or one of many file explorers you might have installed.

This one of the very powerful Android features. Apple's iOS is very different to that, apps can't interact with others so closely and Facebook integration had to be done in iOS6 the hard way for that reason (directly integrated into iOS).

share|improve this answer
    
No need for a task killer. "Force Stop" in the app settings would more than suffice for experimentation. –  Al E. Jun 17 '12 at 15:30
    
Thanks for the hint. applied your suggestion. My main device runs ICS now and I'm now very used to the new swipe to stop feature. Completely forgot that. –  ce4 Jun 17 '12 at 15:45
    
Thanks for the great answer! I followed your suggestion and experimented a bit. Now I understand what's going on and how to control things. I've suggested an edit to the answer with the results of my experiments. –  Jeroen Jun 17 '12 at 18:46
    
:-) and thank you for adding your findings! –  ce4 Jun 17 '12 at 19:04
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.