Skip to content

Commit 05bddbc

Browse files
Merge pull request #316 from barrcodes/patch-2
Fix issue: Capacitor MainActivity cannot extend CordovaActivity
2 parents cd7cc45 + c701ca4 commit 05bddbc

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/android/nl/xservices/plugins/LaunchMyApp.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import android.content.Intent;
44
import org.apache.cordova.CallbackContext;
5-
import org.apache.cordova.CordovaActivity;
65
import org.apache.cordova.CordovaPlugin;
76
import org.apache.cordova.CordovaInterface;
87
import org.apache.cordova.CordovaWebView;
@@ -43,13 +42,13 @@ public void initialize(final CordovaInterface cordova, CordovaWebView webView){
4342
@Override
4443
public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
4544
if (ACTION_CLEARINTENT.equalsIgnoreCase(action)) {
46-
final Intent intent = ((CordovaActivity) this.webView.getContext()).getIntent();
45+
final Intent intent = this.cordova.getActivity().getIntent();
4746
if (resetIntent){
4847
intent.setData(null);
4948
}
5049
return true;
5150
} else if (ACTION_CHECKINTENT.equalsIgnoreCase(action)) {
52-
final Intent intent = ((CordovaActivity) this.webView.getContext()).getIntent();
51+
final Intent intent = this.cordova.getActivity().getIntent();
5352
final String intentString = intent.getDataString();
5453
if (intentString != null && intent.getScheme() != null) {
5554
lastIntentString = intentString;

0 commit comments

Comments
 (0)