Home How to load html pages developed under Framwork7 in android webview
Reply: 0

How to load html pages developed under Framwork7 in android webview

user1814
1#
user1814 Published in June 20, 2018, 10:47 pm

I am working on an application in Android..This is my code. Please guys look into it .

protected void onCreate(Bundle savedInstanceState) { loading = ProgressDialog.show(this, "Please wait...", "Content is loading...", false, false); super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mWebView = (WebView) findViewById(R.id.activity_main_webview); new Handler().postDelayed(new Runnable() {

        /*
         * Showing splash screen with a timer. This will be useful when you
         * want to show case your app logo / company
         */

        @Override
        public void run() {
            // This method will be executed once the timer is over
            // Start your app main activity
            loading.dismiss();
        }
    }, SPLASH_TIME_OUT);

    if (isNetworkStatusAvialable(getApplicationContext())) {
        WebSettings webSettings = mWebView.getSettings();
        webSettings.setAllowFileAccessFromFileURLs(true);
        webSettings.setAllowUniversalAccessFromFileURLs(true);
        webSettings.setJavaScriptEnabled(true);

        mWebView.loadUrl("http://ip_address/CMSHybridApp/");//This loads the index page from the server in browser but fails in android webview

        mWebView.setWebViewClient(new CustomWebViewClient());
      /*  if (isNetworkStatusAvialable(getApplicationContext())) {
            mWebView.setWebViewClient(new MyAppWebViewClient());
        } else {
            Intent i = new Intent(this, Oops.class);
            startActivity(i);
        }*/

    } else {
        // loading = ProgressDialog.show(this, "Please wait...", "Fetching...", false, false);
        Intent i = new Intent(this, Oops.class);
        startActivity(i);
    }
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.307203 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO