0

When I try to launch another app from my app, My app gets force closed.

opendiscord = new Intent(getPackageManager().getLaunchIntentForPackage("com.discord"));

this is my code, The problem is due to I don't have the app installed. How do I make a "if condition" to check whether the app is installed or not before executing this. So no error throws.

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
  • actually my code is on inputmethodservice (in custom keyboard). –  Mar 10 '18 at 06:21
  • 1
    That is a service, you have context. Still think the duplicate applies because you can access the PackageManager from the service and check if the app is installed or not described in the other thread. – Alex Mar 10 '18 at 06:27

0 Answers0