0

Im willing to open KakaoTalk using implicit intent. Following is my code.

PackageManager pm = getActivity().getPackageManager();
        try {

            Intent waIntent = new Intent(Intent.ACTION_SEND);
            waIntent.setType("text/plain");
            String text = "";

            PackageInfo info = pm.getPackageInfo("com.whatsapp", PackageManager.GET_META_DATA);
            waIntent.setPackage("com.kakaotalk");

            waIntent.putExtra(Intent.EXTRA_TEXT, text);
            startActivity(Intent.createChooser(waIntent, "Share with"));

        } catch (PackageManager.NameNotFoundException e) {
            Toast.makeText(getActivity(),"kakao talk not Installed", Toast.LENGTH_SHORT).show();
        }

even though kakao talk is installed in my mobile , it says that kakao talk is not installed. How can I sort this out?

1 Answers1

0

You are catching PackageManager.NameNotFoundException. That could be thrown by pm.getPackageInfo("com.whatsapp", PackageManager.GET_META_DATA);. There, you are asking for com.whatsapp. Presumably, this is not the application ID of the app that you are seeking.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • may I know whats the app id for kakao talk? –  Apr 20 '16 at 13:00
  • @user1241241: I have never heard of this app, and so I do not know what app this is. I see https://play.google.com/store/apps/details?id=com.kakao.talk on the Play Store, which indicates that the application ID is `com.kakao.talk`, but I do not know if this is the app that you are thinking of. – CommonsWare Apr 20 '16 at 13:02