add support java 1.6

This commit is contained in:
lampaa 2018-06-01 10:51:02 +03:00
parent 8da23d0d69
commit 9537dc9816
5 changed files with 32 additions and 27 deletions

View File

@ -4,7 +4,8 @@
Phonegap plugin for check or launch other application, get extras in phonegap app.
Last version 6.1.5
Last version 6.1.6
* Add support java 1.6
* Add support java 1.7
* Add full support activityForResult, sendBroadcast and RegisterReceiver.
* Add types of extras.

View File

@ -1,6 +1,6 @@
{
"name": "com.lampa.startapp",
"version": "6.1.5",
"version": "6.1.6",
"description": "Phonegap plugin for check or launch other application in android device.",
"cordova": {
"id": "com.lampa.startapp",

View File

@ -2,7 +2,7 @@
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
id="com.lampa.startapp"
version="6.1.5">
version="6.1.6">
<name>startApp</name>
<description>Phonegap plugin for check or launch other application in android device.</description>

View File

@ -1,3 +1,11 @@
/**
com.lampa.startapp, ver. 6.1.6
https://github.com/lampaa/com.lampa.startapp
Phonegap plugin for check or launch other application in android device (iOS support).
bug tracker: https://github.com/lampaa/com.lampa.startapp/issues
*/
package com.lampa.startapp;
import android.content.Intent;
@ -7,9 +15,7 @@ import org.apache.cordova.CordovaPlugin;
import java.lang.reflect.Field;
/**
* Created by User on 16.05.2018.
*/
public class Assets extends CordovaPlugin {
protected static final String TAG = "startApp";
protected boolean NO_PARSE_INTENT_VALS = false;

View File

@ -1,5 +1,5 @@
/**
com.lampa.startapp, ver. 6.1.3
com.lampa.startapp, ver. 6.1.6
https://github.com/lampaa/com.lampa.startapp
Phonegap plugin for check or launch other application in android device (iOS support).
@ -38,25 +38,23 @@ public class startApp extends Assets {
* @return Always return true.
*/
public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
switch (action) {
case "start":
this.start(args, callbackContext);
break;
case "check":
this.check(args, callbackContext);
break;
case "receiver":
this.receiver(args, callbackContext);
break;
case "unReceiver":
this.receiver(args, callbackContext);
break;
case "getExtras":
this.getExtras(callbackContext);
break;
case "getExtra":
this.getExtra(args, callbackContext);
break;
if(action.equals("start")) {
this.start(args, callbackContext);
}
else if(action.equals("check")) {
this.check(args, callbackContext);
}
else if(action.equals("receiver")) {
this.receiver(args, callbackContext);
}
else if(action.equals("unReceiver")) {
this.receiver(args, callbackContext);
}
else if(action.equals("getExtras")) {
this.getExtras(callbackContext);
}
else if(action.equals("getExtra")) {
this.getExtra(args, callbackContext);
}
return true;
@ -104,7 +102,7 @@ public class startApp extends Assets {
//cordova.getActivity().getApplicationContext()
cordova.getContext().registerReceiver(receiver, filter);
cordova.getActivity().getApplicationContext().registerReceiver(receiver, filter);
broadcastReceiverHashMap.put(receiver.hashCode(), receiver);
PluginResult pluginResult = new PluginResult(PluginResult.Status.OK, receiver.hashCode());