salahdi / emweather

Automatically exported from code.google.com/p/emweather
0 stars 0 forks source link

Back button behaviour not as expected after opening emweather from a widget #36

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

1. Place a widget on the home screen. Configure the widget to any city.
2. Open emweather from the regular application launcher.
3. Using emweather, bring up a forecast of a second city (different than the 
city configured in the widget)
4. Return to the home screen.
5. Double-tap the widget to open the forecast.
6. Once the forecast is displayed, hit the back button.

What is the expected output? What do you see instead?

I would expect the back button to return me to the home screen when I have 
launched the forecast from a widget.

Instead it appears the back button cycles through previously viewed forecasts.

What version of EmWeather are you using? What is your OS API, ie. 1.5
(Cupcake), 1.6 (Donut), 2.1 (Eclair), 2.2 (Froyo) etc. (if you know it)

EmWeather version 0.9.5.6.7
Running Gingerbread 2.3.4 on Samsung Nexus S

Please provide any additional information below.

Original issue reported on code.google.com by zippanova@gmail.com on 15 Aug 2011 at 4:52

GoogleCodeExporter commented 8 years ago
Hello,

Thanks a lot for creating a bug report and all of the detailed information.

I am going to investigate this.  From first glance, however, this looks to be 
an Android issue and you can witness it within other applications.  From the 
Android OS's point of view, it is not necessarily a bug but a feature.

Essentially, Android has a memory manager that decides when programs are no 
longer needed to be in memory.  Programs are kept in memory to speed up 
accessing them and to store their state information.  For example, you want the 
SMS program to open fast and it is a "feature" for it to open to the 
conversation with the last person you were texting, even if you have been on 
the phone or emailing in the meantime (or using EmWeather :) rather than 
forcing you to always go through the list of SMS conversations each time.  
Android also tries to keep track of the "path" you have taken to get to where 
you are and will guide you back along the path when you press the "back" 
button.  So if you read your email inbox, then choose a particular email, then 
press back, it goes back to the inbox (not the home screen) but when you access 
an SMS message directly from the homescreen (through a notification for 
example) pressing back brings you to the homescreen and not to the conversation 
list in the SMS app.  Sometimes this logic messes up or what Android thinks is 
logical doesn't make sense to people.  This is why, for example, if you check 
one account in gmail, then another, sometimes when you press the back-button 
you return to the first account rather than the homescreen. Or other you open 
the SMS program and it goes directly to a conversation with an individual and 
pressing back brings you to your home screen.  If you wanted to see the whole 
conversation list, this is frustrating.  It's not really a bug... it's a 
"feature" that doesn't always do what we want.

What seems to be happening here is that Android thinks you want to go "back" 
within the EmWeather app, without closing the app itself.  This is because it 
has previous states in memory from the last times you ran EmWeather, this is 
just like gmail going "back" to other accounts instead of going to "back" to 
the homescreen.

I have programmed anything for the "back" button, choosing to let Android guide 
it's behaviour and, in fact, I am not sure I can override it and change it.  I 
am a little reluctant to do so as people may expect Android to act as it 
usually does.  However, I will look into this and see if it doesn't make sense 
to override the back button to always close the app and if it is possible.

Thanks again for the clear and detailed report.
Emilie

Original comment by emweat...@gmail.com on 16 Aug 2011 at 12:09

GoogleCodeExporter commented 8 years ago
I just had an idea to address this issue while still letting Android control 
the back button in most cases. When the app is opened from a widget, store a 
flag indicating this. Then, when the back button is pressed, make a decision 
based on this flag. If the app was opened from a widget, return the user to the 
home screen. Otherwise, let Android decide on the behaviour of the back button 
(i.e. pass through to the Android back button action).

This would add this requested feature without changing the behaviour in any 
other situation.

- Alex

Original comment by zippanova@gmail.com on 24 Nov 2011 at 10:14

GoogleCodeExporter commented 8 years ago
This has been fixed in 1.2.3 of the paid version.

Original comment by emweat...@gmail.com on 31 Mar 2013 at 10:08