0

I'm trying to send the user of my OCR project to the OFFLINE Google Translator but I don't know what should I use to achieve that...

I'v searched alot but nothing meet what i want.

i thought about using Intent with the action " View "

 Intent intent=new Intent();
intent.setAction(android.content.Intent.ACTION_VIEW)

i see this it's not what actually i need

help plz

Community
  • 1
  • 1
20050
  • 11
  • 5

2 Answers2

1
Intent LaunchIntent = getPackageManager().getLaunchIntentForPackage("com.google.android.apps.translate");
startActivity(LaunchIntent);
Mukesh
  • 515
  • 7
  • 21
0

You need to launch an intent referencing the app id (package name) of the app in question. Try this:

public static void launchGoogleTranslateApp(Activity activity) {
    PackageManager manager = activity.getPackageManager();
    Intent intent = manager.getLaunchIntentForPackage("com.google.android.apps.translate");
    intent.addCategory(Intent.CATEGORY_LAUNCHER);
    activity.startActivity(intent);
}
Nilzor
  • 18,082
  • 22
  • 100
  • 167