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 8224335
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T15:02:03+00:00 2026-06-07T15:02:03+00:00

I am Using Following Code to stop reloading the web page public class MainActivity

  • 0

I am Using Following Code to stop reloading the web page

public class MainActivity extends Activity {


WebView webView;

@Override


protected void onSaveInstanceState(Bundle outState) {


    WebView webView1 = (WebView)findViewById(R.id.webView);
     webView1.saveState(outState);


}    

@SuppressLint("SetJavaScriptEnabled")
@Override
public void onCreate(Bundle savedInstanceState) {


    super.onCreate(savedInstanceState);

    setContentView(R.layout.activity_main);

    webView = (WebView)findViewById(R.id.webView);

    String url="http://www.google.com";


             if (savedInstanceState != null)
                        {
                 ((WebView)findViewById(R.id.webView)).restoreState(savedInstanceState);
                        }
             else{

             webView.setWebViewClient(new WebViewClient() {


        public void onPageFinished(WebView view, String url) {

            String name = MainActivity.this.webView.getTitle();
            TextView t=(TextView)findViewById(R.id.title); 

            t.setText(name);
            Toast.makeText(getApplicationContext(), name, Toast.LENGTH_SHORT).show();


        }
    });



    final Activity activity = this;

    final ProgressDialog progressDialog = new ProgressDialog(activity);
    progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
    progressDialog.setMessage("Loading...");
    progressDialog.setCancelable(false);

    final ProgressBar progressBar = (ProgressBar)findViewById(R.id.progressBar1);


    webView.getSettings().setJavaScriptEnabled(true);
    webView.getSettings().setDomStorageEnabled(true);
    webView.getSettings().setUserAgentString("Android");
    webView.setWebChromeClient(new WebChromeClient()
    {
         public void onProgressChanged(WebView view, int progress) {

                progressBar.setVisibility(View.VISIBLE);
                progressDialog.setProgress(0);
                activity.setProgress(progress * 1000);

                progressDialog.incrementProgressBy(progress);

                if(progress > 75)
                    progressBar.setVisibility(View.GONE);
            }
    }
            );


    webView.loadUrl(url);

             }

and used android:configChanges="orientation|keyboard|keyboardHidden" in my manifest file

But when i run it and change orientation of my phone.

The page still get reloaded and progressbar started showing and never dismiss.

can anyone tell me whats wrong in this??

  • 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-07T15:02:07+00:00Added an answer on June 7, 2026 at 3:02 pm

    By default the activity is recreated at orientation change. But you can change it by setting android:configChanges="keyboardHidden|orientation in the declaration of your activity in AndroidManifest.xml and overriding the onConfigurationChanged() method of the activity class.

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

Sidebar

Related Questions

i am using following code. public class MyCount extends CountDownTimer { public MyCount(long millisInFuture,
I am using following code for inserting comments: <div id=2 class=789678> <div id=dynamic2> <span
Using the following code: <a href=/someurl> <div class='mydiv' onMouseOver=document.getElementById('myid').sendEvent('play'); onMouseOut=document.getElementById('myid').sendEvent('stop');> <div id='myid'></div> <script type=text/javascript>
I'm using the following code to fetch something from mongo: class BlockingMongoFetcher include MongoConfig
I'm using the following code fragment to stop a service. However, both the Console.Writeline
Using the following code: #include<stdio.h> #include<time.h> int main() { clock_t start, stop; int i;
Using following code I try to get updated list of checkbuttons' corresponding text values,
I using following code: var search = 'test'; if ($('#sku').find(search) ){ //alert(search); $(document).find(search).css('color','red'); <TABLE>
I am creating date using following code try { newdatetime = new DateTime(2012, 2,
I am using following code for showing a MessageBox with ok and cancel button.

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.