diff options
author | Daniel Schaal <daniel@schaal.email> | 2015-09-29 18:15:51 +0300 |
---|---|---|
committer | Daniel Schaal <daniel@schaal.email> | 2015-10-03 14:58:06 +0300 |
commit | 3368d1e0c1b794c6aa0037e879a1f4d562b70ec4 (patch) | |
tree | 206b4a14af42d1d7f3d8fcbc3be48768b60a3940 /News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/services/SyncItemStateService.java | |
parent | 2c887ff4fbd0180c5c94c7102ae9ab8ef2547642 (diff) |
Use a Future to get the api version.
Diffstat (limited to 'News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/services/SyncItemStateService.java')
-rw-r--r-- | News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/services/SyncItemStateService.java | 22 |
1 files changed, 1 insertions, 21 deletions
diff --git a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/services/SyncItemStateService.java b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/services/SyncItemStateService.java index 44994d0d..909a7c34 100644 --- a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/services/SyncItemStateService.java +++ b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/services/SyncItemStateService.java @@ -46,29 +46,9 @@ public class SyncItemStateService extends IntentService { @Override protected void onHandleIntent(Intent intent) { - OwnCloud_Reader.getInstance().Start_AsyncTask_GetVersion(this, onAsyncTask_GetVersionFinished); + OwnCloud_Reader.getInstance().Start_AsyncTask_PerformItemStateChange(SyncItemStateService.this, null); } - OnAsyncTaskCompletedListener onAsyncTask_GetVersionFinished = new OnAsyncTaskCompletedListener() { - - @Override - public void onAsyncTaskCompleted(int task_id, Object task_result) { - - if(!(task_result instanceof Exception)) - { - String appVersion = task_result.toString(); - SharedPreferences mPrefs = PreferenceManager.getDefaultSharedPreferences(SyncItemStateService.this); - String baseUrl = mPrefs.getString(SettingsActivity.EDT_OWNCLOUDROOTPATH_STRING, ""); - API api = API.GetRightApiForVersion(appVersion, baseUrl); - - OwnCloud_Reader.getInstance().setApi(api); - - OwnCloud_Reader.getInstance().Start_AsyncTask_PerformItemStateChange(SyncItemStateService.this, null); - } - } - }; - - public static boolean isMyServiceRunning(Context context) { ActivityManager manager = (ActivityManager) context.getSystemService(ACTIVITY_SERVICE); for (RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE)) { |