Android Open Source - UTMShuttleAndroid Routes Task






From Project

Back to project page UTMShuttleAndroid.

License

The source code is released under:

GNU General Public License

If you think the Android project UTMShuttleAndroid listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package async;
//from   w  ww.  j  a v  a 2s .co m
import android.os.AsyncTask;

import adapters.TimesListAdapter;
import classes.Routes;
import util.Scraper;


public class RoutesTask extends AsyncTask<Void, Void, Routes> {

    private String month;
    private String date;
    private String year;
    private TimesListAdapter adapter;

    public RoutesTask (String month, String date, String year, TimesListAdapter adapter) {
        this.month = month;
        this.date = date;
        this.year = year;
        this.adapter = adapter;
    }

    protected Routes doInBackground(Void... voids) {
        return Scraper.getDataByDate(this.month, this.date, this.year);
    }

    protected void onPostExecute(Routes result) {
        if (result != null) {
            adapter.setTimes(result.getRoute(45).getTimes());
            adapter.notifyDataSetChanged();
        }
    }
}




Java Source Code List

activities.MainActivity.java
adapters.TimesListAdapter.java
async.NoticesTask.java
async.RoutesTask.java
classes.Route.java
classes.Routes.java
global.App.java
util.NetworkHelper.java
util.Scraper.java