13 |
import android.net.Uri; |
import android.net.Uri; |
14 |
import android.os.AsyncTask; |
import android.os.AsyncTask; |
15 |
import android.os.Bundle; |
import android.os.Bundle; |
16 |
|
import android.util.Log; |
17 |
import android.view.View; |
import android.view.View; |
18 |
import android.widget.ListView; |
import android.widget.ListView; |
19 |
import android.widget.TextView; |
import android.widget.TextView; |
61 |
|
|
62 |
findViewById(R.id.header).setOnClickListener( mapLauncher ); |
findViewById(R.id.header).setOnClickListener( mapLauncher ); |
63 |
|
|
|
NumberFormat format = NumberFormat.getNumberInstance(); |
|
|
format.setMaximumFractionDigits(1); |
|
|
format.setMinimumFractionDigits(1); |
|
|
|
|
|
|
|
64 |
int distance = station.getDistance(); |
int distance = station.getDistance(); |
65 |
((TextView) findViewById(R.id.stationDistance)).setText( format.format((double)distance/1000.0) + " km." ); |
if (distance != 0) { |
66 |
|
NumberFormat format = NumberFormat.getNumberInstance(); |
67 |
|
format.setMaximumFractionDigits(1); |
68 |
|
format.setMinimumFractionDigits(1); |
69 |
|
|
70 |
|
((TextView) findViewById(R.id.stationDistance)).setText( format.format((double)distance/1000.0) + " km." ); |
71 |
|
} else { |
72 |
|
((TextView) findViewById(R.id.stationDistance)).setVisibility(View.GONE); |
73 |
|
} |
74 |
|
|
75 |
|
|
76 |
if (station.isRegional() == false && station.isSTrain() == false) { |
if (station.isRegional() == false && station.isSTrain() == false) { |
202 |
public void onClick(DialogInterface dialog, int id) { |
public void onClick(DialogInterface dialog, int id) { |
203 |
dialog.dismiss(); |
dialog.dismiss(); |
204 |
} |
} |
205 |
}); |
}); |
206 |
builder.show(); |
|
207 |
|
try { |
208 |
|
builder.show(); |
209 |
|
} catch (android.view.WindowManager.BadTokenException e) { |
210 |
|
Log.i("DepartureList", "BadTokenException"); // this can happen if the user switched away from this activity, while doInBackground was running |
211 |
|
} |
212 |
} |
} |
213 |
} |
} |
214 |
|
|