Skip to content

Commit 034727b

Browse files
committed
Merge pull request phonegap#708 from Patrick64/patch-2
[WebIntent Android] update for phonegap 2.0 compatibility
2 parents fc1805f + 73b39b0 commit 034727b

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Android/WebIntent/WebIntent.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
import android.util.Log;
1414
import android.text.Html;
1515

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;
1818

1919
/**
2020
* WebIntent is a PhoneGap plugin that bridges Android intents and web
@@ -73,15 +73,15 @@ public PluginResult execute(String action, JSONArray args, String callbackId) {
7373
if (args.length() != 1) {
7474
return new PluginResult(PluginResult.Status.INVALID_ACTION);
7575
}
76-
Intent i = ((DroidGap) this.ctx).getIntent();
76+
Intent i = ((DroidGap)this.cordova.getContext()).getIntent();
7777
String extraName = args.getString(0);
7878
return new PluginResult(PluginResult.Status.OK, i.hasExtra(extraName));
7979

8080
} else if (action.equals("getExtra")) {
8181
if (args.length() != 1) {
8282
return new PluginResult(PluginResult.Status.INVALID_ACTION);
8383
}
84-
Intent i = ((DroidGap) this.ctx).getIntent();
84+
Intent i = ((DroidGap)this.cordova.getContext()).getIntent();
8585
String extraName = args.getString(0);
8686
if (i.hasExtra(extraName)) {
8787
return new PluginResult(PluginResult.Status.OK, i.getStringExtra(extraName));
@@ -93,7 +93,7 @@ public PluginResult execute(String action, JSONArray args, String callbackId) {
9393
return new PluginResult(PluginResult.Status.INVALID_ACTION);
9494
}
9595

96-
Intent i = ((DroidGap) this.ctx).getIntent();
96+
Intent i = ((DroidGap)this.cordova.getContext()).getIntent();
9797
String uri = i.getDataString();
9898
return new PluginResult(PluginResult.Status.OK, uri);
9999
} else if (action.equals("onNewIntent")) {
@@ -173,7 +173,7 @@ void startActivity(String action, Uri uri, String type, Map<String, String> extr
173173
i.putExtra(key, value);
174174
}
175175
}
176-
this.ctx.startActivity(i);
176+
this.cordova.getActivity().startActivity(i);
177177
}
178178

179179
void sendBroadcast(String action, Map<String, String> extras) {
@@ -184,6 +184,6 @@ void sendBroadcast(String action, Map<String, String> extras) {
184184
intent.putExtra(key, value);
185185
}
186186

187-
((DroidGap) this.ctx).sendBroadcast(intent);
187+
((DroidGap)this.cordova.getContext()).sendBroadcast(intent);
188188
}
189189
}

0 commit comments

Comments
 (0)