Back to project page City-Outdoors-Android.
The source code is released under:
Copyright (c) 2012, Edinburgh Council All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are ...
If you think the Android project City-Outdoors-Android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package uk.co.jarofgreen.cityoutdoors.Service; //from w ww . j a va 2 s . com import uk.co.jarofgreen.cityoutdoors.OurApplication; import uk.co.jarofgreen.cityoutdoors.API.CheckCurrentUserCall; import uk.co.jarofgreen.cityoutdoors.API.FeaturesCall; import android.app.IntentService; import android.content.Intent; import android.content.SharedPreferences; import android.preference.PreferenceManager; import android.util.Log; /** * This reloads only the data about the current user from the server and saves it. * @author James Baster <james@jarofgreen.co.uk> * @copyright City of Edinburgh Council & James Baster * @license Open Source under the 3-clause BSD License * @url https://github.com/City-Outdoors/City-Outdoors-Android */ public class LoadUserDataService extends IntentService { public LoadUserDataService() { super("LoadUserDataService"); } protected void onHandleIntent(Intent intent) { long now = java.lang.System.currentTimeMillis(); SharedPreferences settings=PreferenceManager.getDefaultSharedPreferences(this); try { // get latest data for answeredAllQuestions variable FeaturesCall fc = new FeaturesCall(this, (OurApplication)getApplication()); fc.execute(); // get latest score CheckCurrentUserCall cu = new CheckCurrentUserCall(this, (OurApplication)getApplication()); cu.execute(); } catch (Exception e) { Log.d("APIERROR",e.toString()); // assume it's a net connection error. ignore. Not the best to do. } } }