mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-15 15:41:24 +01:00
revert to standard launchMode to get proper from-Launcher behavior and
specify a pair of flags when background-launching GamesList that strips any stack it has and doesn't launch a new instance. Seems to fix the problems with launching from notifications and invite emails. But then I've thought this fixed before.
This commit is contained in:
parent
888b4f6701
commit
0d6b5914b9
2 changed files with 14 additions and 15 deletions
|
@ -43,7 +43,7 @@
|
|||
|
||||
<activity android:name="GamesList"
|
||||
android:label="@string/title_games_list"
|
||||
android:launchMode="singleTop"
|
||||
android:launchMode="standard"
|
||||
android:configChanges="keyboardHidden|orientation"
|
||||
>
|
||||
<intent-filter>
|
||||
|
|
|
@ -67,22 +67,19 @@ public class DispatchNotify extends Activity {
|
|||
DbgUtils.logf( "DispatchNotify: nothing running" );
|
||||
Intent intent = new Intent( this, GamesList.class );
|
||||
|
||||
/* Flags. Tried Intent.FLAG_ACTIVITY_NEW_TASK. I don't
|
||||
* remember what it fixes, but what it breaks is easy to
|
||||
* duplicate. Launch Crosswords from the home screen making
|
||||
* sure it's the only instance running. Get a networked game
|
||||
* going, and with BoardActivity frontmost check the relay and
|
||||
* select a relay notification. New BoardActivity will come
|
||||
* up, but if you hit home button then Crosswords icon you're
|
||||
* back to games list. Hit back button and you're back to
|
||||
* BoardActivity, and back from there back to GamesList.
|
||||
* That's because a new activity came up from the activity
|
||||
* below thanks to the flag.
|
||||
*/
|
||||
// This combination of flags will bring an existing
|
||||
// GamesList instance to the front, killing any children
|
||||
// it has, or create a new one if none exists. Coupled
|
||||
// with a "standard" launchMode it seems to work, meaning
|
||||
// both that the app preserves its stack in normal use
|
||||
// (you can go to Home with a stack of activities and
|
||||
// return to the top activity on that stack if you
|
||||
// relaunch the app) and that when I launch from here the
|
||||
// stack gets nuked and we don't get a second GamesList
|
||||
// instance.
|
||||
|
||||
intent.setFlags( Intent.FLAG_ACTIVITY_CLEAR_TOP
|
||||
// Intent.FLAG_ACTIVITY_NEW_TASK NO See above
|
||||
);
|
||||
| Intent.FLAG_ACTIVITY_SINGLE_TOP );
|
||||
if ( null != relayIDs ) {
|
||||
intent.putExtra( RELAYIDS_EXTRA, relayIDs );
|
||||
} else if ( null != data ) {
|
||||
|
@ -128,6 +125,7 @@ public class DispatchNotify extends Activity {
|
|||
}
|
||||
}
|
||||
}
|
||||
DbgUtils.logf( "tryHandle(%s)=>%b", data.toString(), handled );
|
||||
return handled;
|
||||
}
|
||||
|
||||
|
@ -148,6 +146,7 @@ public class DispatchNotify extends Activity {
|
|||
}
|
||||
}
|
||||
}
|
||||
DbgUtils.logf( "tryHandle(%s)=>%b", relayIDs.toString(), handled );
|
||||
return handled;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue