mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-03 23:04:08 +01:00
don't offer to copy DB from sdcard when there is none.
This commit is contained in:
parent
598a154693
commit
96e277c7ba
2 changed files with 14 additions and 0 deletions
|
@ -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();
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue