update plugin for 1.7 java and new version 6.1.3

This commit is contained in:
lampaa
2018-05-24 11:29:41 +03:00
parent 4348c5aba3
commit d2464f4b05
3 changed files with 8 additions and 6 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "com.lampa.startapp",
"version": "6.1.2",
"version": "6.1.3",
"description": "Phonegap plugin for check or launch other application in android device.",
"cordova": {
"id": "com.lampa.startapp",
+1 -1
View File
@@ -2,7 +2,7 @@
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
id="com.lampa.startapp"
version="6.1.2">
version="6.1.3">
<name>startApp</name>
<description>Phonegap plugin for check or launch other application in android device.</description>
+6 -4
View File
@@ -1,5 +1,5 @@
/**
com.lampa.startapp, ver. 6.1.1
com.lampa.startapp, ver. 6.1.3
https://github.com/lampaa/com.lampa.startapp
Phonegap plugin for check or launch other application in android device (iOS support).
@@ -27,7 +27,7 @@ import android.net.Uri;
import android.os.Bundle;
public class startApp extends Assets {
private HashMap<Integer, BroadcastReceiver> broadcastReceiverHashMap = new HashMap<Integer, BroadcastReceiver>();
private HashMap<Integer, BroadcastReceiver> broadcastReceiverHashMap = new HashMap<>();
private CallbackContext callbackContext;
/**
* Executes the request and returns PluginResult.
@@ -68,7 +68,7 @@ public class startApp extends Assets {
* @param args
* @param callback
*/
private void receiver(JSONArray args, CallbackContext callback) {
private void receiver(JSONArray args, final CallbackContext callback) {
BroadcastReceiver receiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
@@ -102,6 +102,8 @@ public class startApp extends Assets {
filter.addAction(values.getString(i));
}
//cordova.getActivity().getApplicationContext()
cordova.getContext().registerReceiver(receiver, filter);
broadcastReceiverHashMap.put(receiver.hashCode(), receiver);
@@ -305,7 +307,7 @@ public class startApp extends Assets {
PackageManager pm = cordova.getActivity().getApplicationContext().getPackageManager();
// get package info
PackageInfo PackInfo = pm.getPackageInfo(params.getString("package"), PackageManager.GET_ACTIVITIES);
final PackageInfo PackInfo = pm.getPackageInfo(params.getString("package"), PackageManager.GET_ACTIVITIES);
// create json object
JSONObject info = new JSONObject() {{