Skip to content Skip to sidebar Skip to footer

Launch Android Application From Library Project

I am developing the PushNotification for android application in Android Library. I am unable to launch the android application while clicking the push notification message. I am un

Solution 1:

if your problem is that the activity you wish to provide to the intent is not recognized in the library project, you can use the packageManager.getLaunchIntentForPackage() to get intent to start activity from this package which have CATEGORY_LAUNCHER attribute

StringpackageName= context.getPackageName();
IntentlaunchIntent= context.getPackageManager().getLaunchIntentForPackage(packageName);

then you could replace new Intent(context, "need to launch the android application main activity") with launchIntent

Post a Comment for "Launch Android Application From Library Project"