Browse Source

arect max attack id

Julien Clauter 9 years ago
parent
commit
36538bc708

+ 5 - 0
src/de/tudarmstadt/informatik/hostage/persistence/HostageDBOpenHelper.java

@@ -172,6 +172,11 @@ public class HostageDBOpenHelper extends SQLiteOpenHelper {
 
     private static  SyncDevice thisDevice = null;
     public static SyncDevice currentDevice(){
+        if (thisDevice != null){
+            SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(MainActivity.getContext());
+            int attack_id = pref.getInt("ATTACK_ID_COUNTER", 0);
+            thisDevice.setHighest_attack_id(attack_id);
+        }
         return thisDevice;
     }
     /**