본문 바로가기
프로그래밍 놀이터/안드로이드, Java

[android] how can I know whether an application is installed with packagename?

by 돼지왕 왕돼지 2013. 10. 8.
반응형


 android, how can I know whether an application is installed with packagename?

 

[android] how can I know whether an application is installed with packagename?


public static boolean isAppInstalled( Context context, String packageName ){

  try{

    context.getPackageManager().getPackageInfo( packageName, PackageManager.GET_META_DATA );

    return true;

  }

  catch( Exception e ){

    return false;

  }

}




반응형

댓글