0

I'm trying to grab a link from one activity(Webview) and pass it to another Activity which uses (Geckoview). Upon link click, the app crashes or sometimes go to the main activity instead of the intended activity.

Below is the code from Activity 1

public boolean shouldOverrideUrlLoading(WebView view, String url)
            {
                Intent intent = new Intent(Calendar.this, Tv_Channel.class);
                intent.putExtra("videoUri", url);
                startActivity(intent);

                return false;
            }

The above code should work as a listener and transfer the clicked link to a new activity which opens in the Geckoview Browser. Below is the code in the Second Activity

String videoUrl = getIntent().getStringExtra("videoUri");


geckoSession = new GeckoSession();
      //geckoSession.setNavigationDelegate(navigationDelegate);


        // Workaround for Bug 1758212
        geckoSession.setContentDelegate(new GeckoSession.ContentDelegate() {});

        if (geckoRuntime == null) {
            // GeckoRuntime can only be initialized once per process

             geckoRuntime = GeckoRuntime.getDefault(this);

        }

        geckoSession.open(geckoRuntime);
        geckoview.setSession(geckoSession);

      
        geckoSession.loadUri(videoUrl);


Unfornutately, it crashes every time when going to Activity 2

Below is the error log

java.lang.NoClassDefFoundError: Failed resolution of: Lorg/yaml/snakeyaml/constructor/Constructor;
                                                                                                        at org.mozilla.gecko.util.DebugConfig.fromFile(DebugConfig.java:54)
                                                                                                        at org.mozilla.geckoview.GeckoRuntime.init(GeckoRuntime.java:410)
                                                                                                        at org.mozilla.geckoview.GeckoRuntime.getDefault(GeckoRuntime.java:210)
                                                                                                        at com.kezxi.sllitecricketfootballlivestreamhelper.Tv_Channel.onCreate(Tv_Channel.java:62)

The error points to line 62 which is geckoRuntime = GeckoRuntime.getDefault(this);

What I'm expecting to happen is, from Activity 1... the user clicks a link which is automatically sent to Activity 2 which then gets opened in the Geckoview browser.

Kez XI
  • 9
  • 3

0 Answers0