4

I have a Dictionary.com App installed on my mobile. I am creating another app and would like to know how to interact with Dictionary app using Intent.

If there is any way then please let me know

Renjith
  • 5,783
  • 9
  • 31
  • 42
prateeksarda
  • 949
  • 1
  • 10
  • 15

1 Answers1

1

You can just call your dictionary app from your app in this way..

here com.example.package.ActivityToStart defines your dictionary app

Intent intent = new Intent(Intent.ACTION_MAIN);
intent.setClassName("com.example.package", "com.example.package.ActivityToStart");
startActivity(intent);

another best method is

try{
   PackageManager pm = getPackageManager();
   Intent intent = pm.getLaunchIntentForPackage("com.example.package");
   startActivity(intent);
}catch (Exception e) {
   e.printStackTrace();
}

If you don't know the package name of your dictionary app just check this

Ziad H.
  • 528
  • 1
  • 5
  • 20
Ram kiran Pachigolla
  • 20,897
  • 15
  • 57
  • 78