반응형
Intent intent = mContext.getPackageManager().getLaunchIntentForPackage("ParkageName");
startActivity(intent);


*. 설치된 어플 목록 PackageInfo를 통해 가져오기 - 1

List<PackageInfo> appinfo = getPackageManager().getInstalledPackages(PackageManager.GET_ACTIVITIES);
      for(int i = 0 ; i <appinfo.size() ; i ++){
        PackageInfo pi = appinfo.get(i);
String appname = pi.packageName
}




*. 다른어플 실행 시키기 - 1

ComponentName compName = 
          new ComponentName("패키지명", "클래스명");
Intent actIntent = new Intent(Intent.ACTION_MAIN);
actIntent.addCategory(Intent.CATEGORY_LAUNCHER);
actIntent.setComponent(compName);
act.startActivity(actIntent);







*. 다른어플 실행 시키기 - 2

Intent toLaunch = Util.getLaunchIntentForPackage( CommonDefine.packageName );
  toLaunch.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 
  PendingIntent intentBack = PendingIntent.getActivity( aContext, 0, toLaunch, 0 );





*. 다른어플 실행 시키기 - 3

PackageManager packageManager = getPackageManager();
String packageName = (String) v.getTag();
 try  {
   Intent intent = packageManager.getLaunchIntentForPackage(packageName);
   if(null != intent){
       startActivity(intent);
   }

  }  catch (ActivityNotFoundException e)  {
      e.printStackTrace();
  }


반응형
Posted by Real_G