0

i need help with this code:

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;

public class InicioFragment extends Fragment {

    private WebView mWebView;


    public InicioFragment() {
        // Required empty public constructor

    }


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {




        // Inflate the layout for this fragment
         inflater.inflate(R.layout.fragment_inicio, container, false);

        View rootView = inflater.inflate(R.layout.fragment_inicio, container);
        mWebView = (WebView) rootView.findViewById(R.id.activity_main_webview);
        WebSettings webSettings = mWebView.getSettings();
        webSettings.setJavaScriptEnabled(true);
        mWebView.loadUrl("http://myip/webapp/home.html");
        mWebView.setWebViewClient(new WebViewClient());


    }


}

So.. the app works, but the WebView dont.. just white screen, and i know that my host its ok, because im using a web view in other apps, and im getting an error like this:

glUtilsParamSize: unknow param 0x00000bd0
glUtilsParamSize: unknow param 0x00000b44

Any tips? Thank You !!

user3000019
  • 103
  • 1
  • 10
  • Is this any help? http://stackoverflow.com/questions/22348801/phonegap-eclipse-issue-eglcodeccommon-glutilsparamsize-unknow-param-errors – Anubian Noob Jul 20 '15 at 18:43
  • i already tried that :c this problem just happens when i implement the webview code if i remove it and do something like this: return inflater.inflate(R.layout.fragment_inicio, container, false); it works, but well not with the webView.. – user3000019 Jul 20 '15 at 18:48
  • what is your onCreateView returning ? – Blackbelt Jul 20 '15 at 18:54
  • initial i was returning the "inflater.inflate(R.layout.fragment_inicio, container, false);" and i was starting this inflater with this "setFragment(0, InicioFragment.class);" and it works fine but when i tried to add the webview stuff i doesnt work i tried this too: http://jsfiddle.net/4owgco6s/ – user3000019 Jul 20 '15 at 19:01

1 Answers1

0

Ok guys i fix it, thanks: i will leave the code here:

package com.icetea09.demomaterialdesigndrawermenu;


import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;

import java.util.Timer;
import java.util.TimerTask;

public class InicioFragment extends Fragment {

    private WebView mWebView;


    public InicioFragment() {
        // Required empty public constructor

    }


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {


       /* OLD CODE
       
       View rootView = inflater.inflate(R.layout.fragment_inicio, container);
        mWebView = (WebView) rootView.findViewById(R.id.activity_main_webview);
        WebSettings webSettings = mWebView.getSettings();
        webSettings.setJavaScriptEnabled(true);
        mWebView.loadUrl("http://myip/webapp/home.html");
        mWebView.setWebViewClient(new WebViewClient());

        // Inflate the layout for this fragment
         return inflater.inflate(R.layout.fragment_inicio, container, false);
         */
      
      
      /* NEW CODE */

        View rootView = inflater.inflate(R.layout.fragment_inicio, container, false);

        mWebView = (WebView) rootView.findViewById(R.id.activity_main_webview);
        WebSettings webSettings = mWebView.getSettings();
        webSettings.setJavaScriptEnabled(true);
        mWebView.getSettings().setAppCacheEnabled(false);
        mWebView.loadUrl("http://myip/webapp/home.html");
        mWebView.setWebViewClient(new WebViewClient());



        return rootView;





    }


}

Thank you all :D

user3000019
  • 103
  • 1
  • 10