Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7735325
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T07:28:28+00:00 2026-06-01T07:28:28+00:00

I’m using WebViewClient to browse urls using the emulator. after a while (cannot tell

  • 0

I’m using WebViewClient to browse urls using the emulator. after a while (cannot tell exactly the cause), the pages cannot be loaded anymore or they view takes forever, for the same sites as before that were very fast.
Usually i see under onReceivedError the error -2 (WebViewClient.ERROR_HOST_LOOKUP)
Any help/reference would be appreciated.

Thanks!

W/ThrottleService( 91): unable to find stats for iface rmnet0
D/dalvikvm( 171): GC_CONCURRENT freed 457K, 8% free 6971K/7559K, paused 11ms+7ms
F/NetworkStats( 91): problem reading network stats
F/NetworkStats( 91): java.lang.IllegalStateException: problem parsing idx 1
F/NetworkStats( 91): at com.android.internal.net.NetworkStatsFactory.readNetworkStatsDetail(NetworkStatsFactory.java:300)
F/NetworkStats( 91): at com.android.server.NetworkManagementService.getNetworkStatsUidDetail(NetworkManagementService.java:1282)
F/NetworkStats( 91): at com.android.server.net.NetworkStatsService.performPollLocked(NetworkStatsService.java:831)
F/NetworkStats( 91): at com.android.server.net.NetworkStatsService.performPoll(NetworkStatsService.java:799)
F/NetworkStats( 91): at com.android.server.net.NetworkStatsService.access$100(NetworkStatsService.java:128)
F/NetworkStats( 91): at com.android.server.net.NetworkStatsService$3.onReceive(NetworkStatsService.java:633)
F/NetworkStats( 91): at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:728)
F/NetworkStats( 91): at android.os.Handler.handleCallback(Handler.java:605)
F/NetworkStats( 91): at android.os.Handler.dispatchMessage(Handler.java:92)
F/NetworkStats( 91): at android.os.Looper.loop(Looper.java:137)
F/NetworkStats( 91): at android.os.HandlerThread.run(HandlerThread.java:60)
F/NetworkStats( 91): Caused by: java.io.FileNotFoundException: /proc/net/xt_qtaguid/stats: open failed: ENOENT (No such file or directory)
F/NetworkStats( 91): at libcore.io.IoBridge.open(IoBridge.java:406)
F/NetworkStats( 91): at java.io.FileInputStream.(FileInputStream.java:78)
F/NetworkStats( 91): at com.android.internal.net.NetworkStatsFactory.readNetworkStatsDetail(NetworkStatsFactory.java:269)
F/NetworkStats( 91): … 10 more
F/NetworkStats( 91): Caused by: libcore.io.ErrnoException: open failed: ENOENT (No such file or directory)
F/NetworkStats( 91): at libcore.io.Posix.open(Native Method)
F/NetworkStats( 91): at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110)
F/NetworkStats( 91): at libcore.io.IoBridge.open(IoBridge.java:390)
F/NetworkStats( 91): … 12 more
D/dalvikvm( 91): GC_CONCURRENT freed 508K, 8% free 9025K/9735K, paused 6ms+24ms
W/ThrottleService( 91): unable to find stats for iface rmnet0

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T07:28:29+00:00Added an answer on June 1, 2026 at 7:28 am

    Use below working code ::

    public class Android_Activity extends Activity {
    private Android_Activity _activity;
        @Override
            public void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);     
                getWindow().requestFeature(Window.FEATURE_PROGRESS);
                _activity = this;   
                setContentView(R.layout.main);
    
                mwebview=(WebView)view.findViewById(R.id.webview);
                mwebview.getSettings().setJavaScriptEnabled(true);
                mwebview.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
    
                if(checkInternetConnection(_activity)==true){
                    if(savedInstanceState==null)
                        mwebview.loadUrl("http://abc.com");
                    else
                        mwebview.restoreState(savedInstanceState);
                }
                else{
                    AlertDialog.Builder builder = new AlertDialog.Builder(_activity);
                    builder.setMessage("Please check your network connection.")
                           .setCancelable(false)
                           .setPositiveButton("OK", new DialogInterface.OnClickListener() {
                               public void onClick(DialogInterface dialog, int id) {
    
                               }
                           });
    
                    AlertDialog alert = builder.create();    
                    alert.show();
                }
                mwebview.setWebChromeClient(new WebChromeClient() {
    
                    @Override
                    public void onProgressChanged(WebView view, int progress) { 
                        if(mwebview.getVisibility()==View.VISIBLE)
                        {
                            _activity.setProgress(progress * 100);
                        }
                    }
                });
                mwebview.setWebViewClient(new HelloWebViewClient());
            }
    
    
            //HelloWebViewClient class for webview
            private class HelloWebViewClient extends WebViewClient {
    
                @Override
                public void onPageStarted(WebView view, String url, Bitmap favicon) {
                    // TODO Auto-generated method stub
                    super.onPageStarted(view, url, favicon);
                }
                @Override
                public void onReceivedError(WebView view, int errorCode,
                        String description, String failingUrl) {
                    // TODO Auto-generated method stub
                    super.onReceivedError(view, errorCode, description, failingUrl);
    
                }
                @Override
                public void onPageFinished(WebView view, String url) {
                    // TODO Auto-generated method stub
                    super.onPageFinished(view, url);
                }
                @Override
                public boolean shouldOverrideUrlLoading(WebView view, String url) {
                    // Otherwise, the link is not for a page on my site, so launch another Activity that handles URLs
                    view.loadUrl(url);
                    return true;
                }
    
            }   //HelloWebViewClient-class
            @Override
            public boolean onKeyDown(int keyCode, KeyEvent event) {
                // Check if the key event was the Back button and if there's history
                if ((keyCode == KeyEvent.KEYCODE_BACK) && mwebview.canGoBack() ){
                    mwebview.goBack();
                    return true;
                }
                // If it wasn't the Back key or there's no web page history, bubble up to the default
                // system behavior (probably exit the activity)
                return super.onKeyDown(keyCode, event);
            }
            //To check whether network connection is available on device or not
                public static boolean checkInternetConnection(Activity _activity) {
                    ConnectivityManager conMgr = (ConnectivityManager) _activity.getSystemService(Context.CONNECTIVITY_SERVICE);
                    if (conMgr.getActiveNetworkInfo() != null
                            && conMgr.getActiveNetworkInfo().isAvailable()
                            && conMgr.getActiveNetworkInfo().isConnected()) 
                        return true;
                    else
                        return false;
                }//checkInternetConnection()
    }
    

    And also in your main.xml layout you must have a webview with id webview

    Then replace the below lines and try

     if(savedInstanceState==null)
                        mwebview.loadUrl("http://abc.com");
                    else
                        mwebview.restoreState(savedInstanceState);
    

    with.. mwebview.loadUrl(“http://abc.com”);

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I am reading a book about Javascript and jQuery and using one of the
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We are using XSLT to translate a RIXML file to XML. Our RIXML contains

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.