13
13
import android .util .Log ;
14
14
import android .text .Html ;
15
15
16
- import com . phonegap .api .Plugin ;
17
- import com . phonegap .api .PluginResult ;
16
+ import org . apache . cordova .api .Plugin ;
17
+ import org . apache . cordova .api .PluginResult ;
18
18
19
19
/**
20
20
* WebIntent is a PhoneGap plugin that bridges Android intents and web
@@ -73,15 +73,15 @@ public PluginResult execute(String action, JSONArray args, String callbackId) {
73
73
if (args .length () != 1 ) {
74
74
return new PluginResult (PluginResult .Status .INVALID_ACTION );
75
75
}
76
- Intent i = ((DroidGap ) this .ctx ).getIntent ();
76
+ Intent i = ((DroidGap )this .cordova . getContext () ).getIntent ();
77
77
String extraName = args .getString (0 );
78
78
return new PluginResult (PluginResult .Status .OK , i .hasExtra (extraName ));
79
79
80
80
} else if (action .equals ("getExtra" )) {
81
81
if (args .length () != 1 ) {
82
82
return new PluginResult (PluginResult .Status .INVALID_ACTION );
83
83
}
84
- Intent i = ((DroidGap ) this .ctx ).getIntent ();
84
+ Intent i = ((DroidGap )this .cordova . getContext () ).getIntent ();
85
85
String extraName = args .getString (0 );
86
86
if (i .hasExtra (extraName )) {
87
87
return new PluginResult (PluginResult .Status .OK , i .getStringExtra (extraName ));
@@ -93,7 +93,7 @@ public PluginResult execute(String action, JSONArray args, String callbackId) {
93
93
return new PluginResult (PluginResult .Status .INVALID_ACTION );
94
94
}
95
95
96
- Intent i = ((DroidGap ) this .ctx ).getIntent ();
96
+ Intent i = ((DroidGap )this .cordova . getContext () ).getIntent ();
97
97
String uri = i .getDataString ();
98
98
return new PluginResult (PluginResult .Status .OK , uri );
99
99
} else if (action .equals ("onNewIntent" )) {
@@ -173,7 +173,7 @@ void startActivity(String action, Uri uri, String type, Map<String, String> extr
173
173
i .putExtra (key , value );
174
174
}
175
175
}
176
- this .ctx .startActivity (i );
176
+ this .cordova . getActivity () .startActivity (i );
177
177
}
178
178
179
179
void sendBroadcast (String action , Map <String , String > extras ) {
@@ -184,6 +184,6 @@ void sendBroadcast(String action, Map<String, String> extras) {
184
184
intent .putExtra (key , value );
185
185
}
186
186
187
- ((DroidGap ) this .ctx ).sendBroadcast (intent );
187
+ ((DroidGap )this .cordova . getContext () ).sendBroadcast (intent );
188
188
}
189
189
}
0 commit comments