CommonToolsDemo/commontools/src/main/java/com/android/commontools/util/AppUtil.java
/**
	 * whether app can Launch the main activity.
	 * Return true when can Launch,otherwise return false.
	 * @param context
	 * @param packageName
	 * @return
	 */
whether app can Launch the main activity.
Return true when can Launch,otherwise return false.
@param context
@param packageName
@return
whether app can Launch the main activity . Return true when can Launch otherwise return false . @param context @param packageName @return
public static boolean appCanLaunchTheMainActivity(Context context,String packageName){
		boolean canLaunchTheMainActivity=false;
		do{
			if((null==context)||TextUtils.isEmpty(packageName)){
				break;
			}
			PackageManager pm=context.getPackageManager();
			Intent intent=pm.getLaunchIntentForPackage(packageName);
			canLaunchTheMainActivity=(null==intent)?(false):(true);
		}while(false);
		return canLaunchTheMainActivity;
	}
public static boolean appCanLaunchTheMainActivity ( Context context , String packageName ) { boolean canLaunchTheMainActivity = false ; do { if ( ( null == context ) || TextUtils . isEmpty ( packageName ) ) { break ; } PackageManager pm = context . getPackageManager ( ) ; Intent intent = pm . getLaunchIntentForPackage ( packageName ) ; canLaunchTheMainActivity = ( null == intent ) ? ( false ) : ( true ) ; } while ( false ) ; return canLaunchTheMainActivity ; }
whether app can Launch the main activity.
whether app can Launch the main activity .