Back to project page field-data-app.
The source code is released under:
MIT License
If you think the Android project field-data-app 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 nz.cri.gns.springs; /*from w w w.j av a2 s. com*/ import java.util.List; import nz.cri.gns.springs.util.CustomExceptionHandler; import android.app.Application; import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; public class SpringsApplication extends Application { private static Context context; public void onCreate(){ super.onCreate(); SpringsApplication.context = getApplicationContext(); Thread.setDefaultUncaughtExceptionHandler(new CustomExceptionHandler()); } public static Context getAppContext() { return SpringsApplication.context; } public static boolean isIntentAvailable(Context context, String action) { final PackageManager packageManager = context.getPackageManager(); final Intent intent = new Intent(action); List<ResolveInfo> list = packageManager.queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY); return list.size() > 0; } }