mirror of
https://github.com/lampaa/com.lampa.startapp.git
synced 2026-05-20 00:01:31 +08:00
Merge pull request #52 from calclavia/master
Fixed setPackage call for LaunchIntent
This commit is contained in:
@@ -81,15 +81,14 @@ public class startApp extends CordovaPlugin {
|
||||
if (args.get(0) instanceof JSONObject) {
|
||||
params = args.getJSONObject(0);
|
||||
|
||||
LaunchIntent = new Intent();
|
||||
|
||||
/**
|
||||
* set package
|
||||
* http://developer.android.com/reference/android/content/Intent.html#setPackage(java.lang.String)
|
||||
*/
|
||||
if(params.has("package")) {
|
||||
LaunchIntent = cordova.getActivity().getPackageManager().getLaunchIntentForPackage(params.getString("package"));
|
||||
}
|
||||
else {
|
||||
LaunchIntent = new Intent();
|
||||
LaunchIntent.setPackage(params.getString("package"));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user