Changeset View
Changeset View
Standalone View
Standalone View
src/it/reyboz/bustorino/backend/utils.java
Show First 20 Lines • Show All 131 Lines • ▼ Show 20 Lines | public abstract class utils { | ||||
* | * | ||||
* @param url URL | * @param url URL | ||||
*/ | */ | ||||
public static void openIceweasel(String url, Context context) { | public static void openIceweasel(String url, Context context) { | ||||
Intent browserIntent1 = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); | Intent browserIntent1 = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); | ||||
if (browserIntent1.resolveActivity(context.getPackageManager()) != null) { | if (browserIntent1.resolveActivity(context.getPackageManager()) != null) { | ||||
//check we have an activity ready to receive intents (otherwise, there will be a crash) | //check we have an activity ready to receive intents (otherwise, there will be a crash) | ||||
context.startActivity(browserIntent1); | context.startActivity(browserIntent1); | ||||
} else{ | |||||
Log.e("BusTO","openIceweasel can't find a browser"); | |||||
} | } | ||||
} | } | ||||
public static ArrivalsFetcher[] getDefaultArrivalsFetchers(){ | public static ArrivalsFetcher[] getDefaultArrivalsFetchers(){ | ||||
return new ArrivalsFetcher[]{ new MatoAPIFetcher(), | return new ArrivalsFetcher[]{ new MatoAPIFetcher(), | ||||
new FiveTAPIFetcher(), new GTTJSONFetcher(), new FiveTScraperFetcher()}; | new FiveTAPIFetcher(), new GTTJSONFetcher(), new FiveTScraperFetcher()}; | ||||
} | } | ||||
/** | /** | ||||
Show All 36 Lines |
Public contents are in Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) or GNU Free Documentation License (at your option) unless otherwise noted. · Contact / Register