0

I have an Android application that runs another app and I use this code:

public void launchGoogleChrome(View view) {
        Intent launchGoogleChrome = getPackageManager().getLaunchIntentForPackage("com.android.chrome");
        startActivity(launchGoogleChrome);
    }

but if the application does not have any icon, how to start it?

Hugues M.
  • 19,846
  • 6
  • 37
  • 65
Mo Me
  • 43
  • 1
  • 8
  • What do you mean by "application don`t have any icon" ? – Zakir Jun 15 '17 at 01:48
  • Why you say dont have icon? are you sure? – josedlujan Jun 15 '17 at 01:51
  • its hidden i need to run it from another apk – Mo Me Jun 15 '17 at 01:59
  • activity is null – Mo Me Jun 15 '17 at 02:17
  • without activity – Mo Me Jun 15 '17 at 02:21
  • (Removed irrelevant tags and improved grammar, but did not attempt to rephrase, as question is unfortunately unclear I might destroy information). As far as I know, if the app is not running yet, starting an activity by passing an intent should start the app. Maybe the problem is *how* you create & pass it, or somewhere else completely. – Hugues M. Jun 15 '17 at 08:49
  • have you tried other methods: https://stackoverflow.com/a/4073745/940834 https://stackoverflow.com/questions/12852087/launch-another-app-within-an-app-for-android – IAmGroot Jun 15 '17 at 09:07

1 Answers1

0

If you are lost in Home screen and can't figure out the launcher icon, you can always use adb commands to start the application:-

adb shell am start -n com.package.name/com.android.chrome OR <your package name>
Zakir
  • 2,222
  • 21
  • 31