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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T10:27:36+00:00 2026-06-12T10:27:36+00:00

In my UI i check the network availability in a button click listner NewButton.setOnClickListener(new

  • 0

In my UI i check the network availability in a button click listner

NewButton.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {
                if(isInternetAvailable)
                {
                Intent intent = new Intent(FeaturedListActivity.this,
                        NewJewelsActivity.class);
                startActivity(intent);
                finish();
                }
                else
                {
                    MyAlertDialog.ShowAlertDialog(FeaturedListActivity.this, "", "Check Network Connection.", "OK");    
                }
            }
        });

I check network availability using the following code

public boolean isNetworkAvailable() {
          ConnectivityManager connectivityManager= (ConnectivityManager) getSystemService(getApplicationContext().CONNECTIVITY_SERVICE);
            NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo();
            return activeNetworkInfo != null;

Now my problem is when i start the app with the wifi in off state the condition will work and will show the “check network connection” dialog. And now i press the center button of the phone and turn on the wifi and coming back to the screen from where i left.Now the wifi is in ON state and it still shows “check network connection”.If i restart the app it will not show the dialog.How can i solve 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-12T10:27:37+00:00Added an answer on June 12, 2026 at 10:27 am

    You should use a broadcast receiver to get your app notified about the changes in the network state.

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

Sidebar

Related Questions

Hai i am new bie to Android. i need to check the network connection
I am using readability class to check network availability and it works fine with
I want to check network and Internet availability in Action Script programming language. please
I'm trying to check network available or not. But in my emulator it always
How to check that network is available or not on android device programmatically, which
Duplicate of : C# - How do I check for a network connection Hello,
We were using Apple's Reachability a few months ago to check for the network
I'm writing code to check if there is a network connection present. In a
Possible Duplicate: How can I check if an ip is in a network in
I'm trying to use fileexists to check if a file exists on a network

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.