mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-30 08:34:16 +01:00
rename method and add variant then remove duplicated code. No behavior change.
This commit is contained in:
parent
a4e995742f
commit
f75318e9d0
4 changed files with 9 additions and 13 deletions
|
@ -898,7 +898,7 @@ public class GameConfig extends XWActivity
|
|||
private void launchGame()
|
||||
{
|
||||
if ( m_notNetworkedGame || m_car.ip_relay_invite.length() > 0 ) {
|
||||
GameUtils.launchGame( this, m_path );
|
||||
GameUtils.launchGameAndFinish( this, m_path );
|
||||
} else {
|
||||
showOKOnlyDialog( R.string.no_empty_rooms );
|
||||
}
|
||||
|
|
|
@ -392,6 +392,11 @@ public class GameUtils {
|
|||
Intent intent = new Intent( Intent.ACTION_EDIT, uri,
|
||||
activity, BoardActivity.class );
|
||||
activity.startActivity( intent );
|
||||
}
|
||||
|
||||
public static void launchGameAndFinish( Activity activity, String path )
|
||||
{
|
||||
launchGame( activity, path );
|
||||
activity.finish();
|
||||
}
|
||||
|
||||
|
|
|
@ -406,7 +406,7 @@ public class GamesList extends XWListActivity
|
|||
GameUtils.doConfig( this, path, clazz );
|
||||
} else {
|
||||
if ( checkWarnNoDict( path ) ) {
|
||||
startForPath( path );
|
||||
GameUtils.launchGame( this, path );
|
||||
}
|
||||
}
|
||||
m_invalPath = path;
|
||||
|
@ -540,15 +540,6 @@ public class GamesList extends XWListActivity
|
|||
}
|
||||
}
|
||||
|
||||
private void startForPath( String path )
|
||||
{
|
||||
File file = new File( path );
|
||||
Uri uri = Uri.fromFile( file );
|
||||
Intent intent = new Intent( Intent.ACTION_EDIT, uri,
|
||||
this, BoardActivity.class );
|
||||
startActivity( intent );
|
||||
}
|
||||
|
||||
// Launch the first of these for which there's a dictionary
|
||||
// present.
|
||||
private void startFirstHasDict( Intent intent )
|
||||
|
@ -560,7 +551,7 @@ public class GamesList extends XWListActivity
|
|||
for ( String relayID : relayIDs ) {
|
||||
String path = DBUtils.getPathFor( this, relayID );
|
||||
if ( GameUtils.gameDictHere( this, path ) ) {
|
||||
startForPath( path );
|
||||
GameUtils.launchGame( this, path );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -94,7 +94,7 @@ public class RelayGameActivity extends XWActivity
|
|||
showOKOnlyDialog( R.string.no_empty_rooms );
|
||||
} else {
|
||||
saveRoomAndName( room );
|
||||
GameUtils.launchGame( this, m_path );
|
||||
GameUtils.launchGameAndFinish( this, m_path );
|
||||
}
|
||||
} else if ( view == m_configButton ) {
|
||||
saveRoomAndName( room );
|
||||
|
|
Loading…
Add table
Reference in a new issue