diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/DBUtils.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/DBUtils.java index 477a679ab..a036cc9e4 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/DBUtils.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/DBUtils.java @@ -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(); diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesList.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesList.java index 2d8f3b2ec..93eca3af1 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesList.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesList.java @@ -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 ); }