master
Vitaliy Filippov 2016-03-06 02:13:55 +03:00
parent 038c1f7388
commit 35cf875e26
1 changed files with 5 additions and 3 deletions

View File

@ -52,6 +52,8 @@ public class ElectronReminderService extends IntentService
protected void onHandleIntent(Intent intent) protected void onHandleIntent(Intent intent)
{ {
String action = intent.getAction(); String action = intent.getAction();
if (action == null)
action = "refresh_all";
FileOutputStream fs = null; FileOutputStream fs = null;
InputStream is = null; InputStream is = null;
try try
@ -68,7 +70,7 @@ public class ElectronReminderService extends IntentService
Intent i = new Intent("cities_loaded"); Intent i = new Intent("cities_loaded");
LocalBroadcastManager.getInstance(this).sendBroadcast(i); LocalBroadcastManager.getInstance(this).sendBroadcast(i);
} }
else if (action == "load_stations") else if (action.equals("load_stations"))
{ {
String cityId = intent.getStringExtra("cityId"); String cityId = intent.getStringExtra("cityId");
initToken(); initToken();
@ -79,7 +81,7 @@ public class ElectronReminderService extends IntentService
Intent i = new Intent("stations_loaded"); Intent i = new Intent("stations_loaded");
LocalBroadcastManager.getInstance(this).sendBroadcast(i); LocalBroadcastManager.getInstance(this).sendBroadcast(i);
} }
else if (action == "load_trips") else if (action.equals("load_trips"))
{ {
String from = intent.getStringExtra("from"); String from = intent.getStringExtra("from");
String to = intent.getStringExtra("to"); String to = intent.getStringExtra("to");
@ -90,7 +92,7 @@ public class ElectronReminderService extends IntentService
Intent i = new Intent("trips_loaded"); Intent i = new Intent("trips_loaded");
LocalBroadcastManager.getInstance(this).sendBroadcast(i); LocalBroadcastManager.getInstance(this).sendBroadcast(i);
} }
else if (action == "refresh_all") else if (action.equals("refresh_all"))
{ {
File file = new File(getFilesDir(), "reminders.xml"); File file = new File(getFilesDir(), "reminders.xml");
if (file.exists()) if (file.exists())