1

i have a problem with gridview and webview, Im a junior development.

I have 3 Activities.

the first have a splashScreenActivity that Loads the application startup. the second is an activity that load a gridview

gridView gridview = (GridView) findViewById(R.id.gridview);
        gridview.setAdapter(new ImageAdapter(this));

        gridview.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
                String urlP;
                switch (position){
                    case 0: urlP ="https://geekytheory.com";
                        break;
                    case 1: urlP ="http://stackoverflow.com";
                        break;
                    case 2: urlP="http://todoretail.com";
                        break;
                    case 3: urlP="http://google.com.mx";
                        break;
                    default: urlP="http://facebook.com";
                        break;
                }
                Intent i = new Intent(MainActivity.this,Details.class);
                i.putExtra("Link",urlP);//Posición del elemento
                startActivity(i);
            }

and then load and another activity, that receiving the intent

WebView myWebView = (WebView) this.findViewById(R.id.webView);
        CustomWebViewClient myCustomWebViewClient = new CustomWebViewClient();
        myWebView.setWebViewClient(myCustomWebViewClient);
        // Enable JavaScript WebSettings webSettings =
       // WebSettings webSettings = myWebView.getSettings();
        //webSettings.setJavaScriptEnabled(true);
        // Provide a WebViewClient for your WebView
        myWebView.setWebViewClient(new WebViewClient());
        String url=getIntent().getStringExtra("url");
            myWebView.loadUrl(url);

when I click on the gridview this loads the page but not webview, and the logcat shows the following:

746-746/com.manish.customgridview W/dalvikvm﹕ PR_CAPBSET_DROP 0 failed: Invalid argument. Please make sure your kernel is compiled with file capabilities support enabled.
03-12 17:44:30.085      746-746/com.manish.customgridview W/dalvikvm﹕ PR_CAPBSET_DROP 1 failed: Invalid argument. Please make sure your kernel is compiled with file capabilities support enabled.
03-12 17:44:30.085      746-746/com.manish.customgridview W/dalvikvm﹕ PR_CAPBSET_DROP 2 failed: Invalid argument. Please make sure your kernel is compiled with file capabilities support enabled.

and

914-931/com.manish.customgridview E/cutils-trace﹕ Error opening trace file: No such file or directory (2)
03-12 17:57:20.816      914-914/com.manish.customgridview D/TilesManager﹕ Starting TG #0, 0x2a234f50

I'm doing wrong? where is the error?

Thanks

  • 1
    You're putting the String extra with the key 'Link' but trying to get the String extra with the key 'url' ? – Martin Pearman Mar 12 '15 at 23:18
  • I am sending the url of the switch in the position of gridview , so that it attempts to open the link , do not know if I 'm doing well , I saw a similar response and try to adapt to what I 'm using. – Irwing Soto Mar 12 '15 at 23:26
  • @MartinPearman This should be an **answer**, not a comment. Since you spotted out the solution which solves the problem. – Phantômaxx Mar 13 '15 at 08:20
  • @IrwingSoto As Martin Pearman told you, the put and the get names **must be the same**. If you put `Link`, you must get `Link` or if you put `url` then you can get `url`. You can't put `Link` and get `url` – Phantômaxx Mar 13 '15 at 08:23
  • @DerGolem thanks and MartinPearman I solve my problem. – Irwing Soto Mar 13 '15 at 18:06

0 Answers0