0

I'm able load the URL in my WebView. But if I perform some action (like click event), I'm getting following error in LogCat:

Unable to get value of the property 't': object is null or undefinedundefined

But if I perform some events from the emulator's browser, it is working fine.

Here is the code, based on the post:

public class MainActivity extends Activity {

WebView mWebview = null;
String URL = "********";  // Masked intentionally.

@Override
public void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);

    //setContentView(R.layout.activity_main); //Not required as per comment given by Raghunandan.

    mWebview  = new WebView(this);

    mWebview.getSettings().setJavaScriptEnabled(true); // enable javascript

    final Activity activity = this;

    mWebview.setWebChromeClient(new WebChromeClient());

    mWebview.setWebViewClient(new WebViewClient() {
        public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
            Toast.makeText(activity, description, Toast.LENGTH_SHORT).show();
        }
    });

    mWebview .loadUrl(URL);
    setContentView(mWebview );

    }
}

Note: Web page is developed using AngularJS.

I've added the below property in Manifiest.xml:

<uses-permission android:name="android.permission.INTERNET" /> 
Gokul Nath KP
  • 15,485
  • 24
  • 88
  • 126

0 Answers0