don't offer to copy DB from sdcard when there is none.

This commit is contained in:
Eric House 2012-09-20 07:29:00 -07:00
parent 598a154693
commit 96e277c7ba
2 changed files with 14 additions and 0 deletions

View file

@ -1146,6 +1146,14 @@ public class DBUtils {
}
}
public static boolean gameDBExists( Context context )
{
String name = DBHelper.getDBName();
File sdcardDB = new File( Environment.getExternalStorageDirectory(),
name );
return sdcardDB.exists();
}
private static void copyGameDB( Context context, boolean toSDCard )
{
String name = DBHelper.getDBName();

View file

@ -545,6 +545,12 @@ public class GamesList extends XWListActivity
MenuItem item = menu.findItem( id );
item.setVisible( visible );
}
if ( visible && !DBUtils.gameDBExists( this ) ) {
MenuItem item = menu.findItem( R.id.gamel_menu_loaddb );
item.setVisible( false );
}
return super.onPrepareOptionsMenu( menu );
}