If you think the Android project Go2-Rennes 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
/*******************************************************************************
* Copyright (c) 2011 Michel DAVID mimah35-at-gmail.com
* //fromwww.java2s.com
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/package fr.gotorennes;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.content.DialogInterface.OnCancelListener;
import android.os.AsyncTask;
publicclass ItineraireBusDetailActivity extends AbstractMapActivity {
private AsyncTask<String, String, Itineraire> t;
@Override
protectedint getLayout() {
return R.layout.map_itineraire;
}
@Override
protectedvoid init() {
final Itineraire itineraire = goToRennes.itineraireCourant;
final ProgressDialog waitDialog = ProgressDialog.show(this, getString(R.string.titre), getString(R.string.itineraire), true, true, new OnCancelListener() {
@Override
publicvoid onCancel(DialogInterface dialog) {
if(t != null){
t.cancel(true);
}
finish();
}
});
t = new AsyncTask<String, String, Itineraire>() {
@Override
protected Itineraire doInBackground(String... params) {
waitDialog.setMessage("Calcul des tracs");
calculeRoutes(itineraire);
return itineraire;
}
@Override
protectedvoid onPostExecute(Itineraire result) {
populateItineraireDetails(result);
waitDialog.dismiss();
}
@Override
protectedvoid onProgressUpdate(String... values) {
waitDialog.setMessage(values[0]);
}
};
t.execute();
}
@Override
protected String getTrackingName() {
return"itineraireBus";
}
@Override
protectedvoid loadProximityData() {
// Rien
}
}