mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-18 22:26:30 +01:00
preserve selection across orientation changes
This commit is contained in:
parent
f88e7a89f0
commit
03b7a6d45f
1 changed files with 14 additions and 2 deletions
|
@ -74,6 +74,8 @@ public class GamesList extends XWExpandableListActivity
|
|||
|
||||
private static final String SAVE_ROWID = "SAVE_ROWID";
|
||||
private static final String SAVE_ROWIDS = "SAVE_ROWIDS";
|
||||
private static final String SAVE_SELGAMES = "SAVE_SELGAMES";
|
||||
private static final String SAVE_SELGROUPS = "SAVE_SELGROUPS";
|
||||
private static final String SAVE_GROUPID = "SAVE_GROUPID";
|
||||
private static final String SAVE_DICTNAMES = "SAVE_DICTNAMES";
|
||||
|
||||
|
@ -370,10 +372,9 @@ public class GamesList extends XWExpandableListActivity
|
|||
// scary, but worth playing with:
|
||||
// Assert.assertTrue( isTaskRoot() );
|
||||
|
||||
getBundledData( savedInstanceState );
|
||||
|
||||
m_selGames = new HashSet<Long>();
|
||||
m_selGroupIDs = new HashSet<Long>();
|
||||
getBundledData( savedInstanceState );
|
||||
|
||||
setContentView(R.layout.game_list);
|
||||
ExpandableListView listview = getExpandableListView();
|
||||
|
@ -442,6 +443,8 @@ public class GamesList extends XWExpandableListActivity
|
|||
super.onSaveInstanceState( outState );
|
||||
outState.putLong( SAVE_ROWID, m_rowid );
|
||||
outState.putLongArray( SAVE_ROWIDS, m_rowids );
|
||||
outState.putLongArray( SAVE_SELGAMES, getSelRowIDs() );
|
||||
outState.putLongArray( SAVE_SELGROUPS, getSelGroupIDs() );
|
||||
outState.putLong( SAVE_GROUPID, m_groupid );
|
||||
outState.putString( SAVE_DICTNAMES, m_missingDictName );
|
||||
if ( null != m_netLaunchInfo ) {
|
||||
|
@ -454,6 +457,15 @@ public class GamesList extends XWExpandableListActivity
|
|||
if ( null != bundle ) {
|
||||
m_rowid = bundle.getLong( SAVE_ROWID );
|
||||
m_rowids = bundle.getLongArray( SAVE_ROWIDS );
|
||||
long[] tmp;
|
||||
tmp = bundle.getLongArray( SAVE_SELGAMES );
|
||||
for ( long ll : tmp ) {
|
||||
m_selGames.add( ll );
|
||||
}
|
||||
tmp = bundle.getLongArray( SAVE_SELGROUPS );
|
||||
for ( long ll : tmp ) {
|
||||
m_selGroupIDs.add( ll );
|
||||
}
|
||||
m_groupid = bundle.getLong( SAVE_GROUPID );
|
||||
m_netLaunchInfo = new NetLaunchInfo( bundle );
|
||||
m_missingDictName = bundle.getString( SAVE_DICTNAMES );
|
||||
|
|
Loading…
Reference in a new issue