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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T06:55:12+00:00 2026-05-21T06:55:12+00:00

I create application using map. It works, but when there’s no internet or wifi

  • 0

I create application using map.

It works, but when there’s no internet or wifi the application crashes.

Instead of crashing I want to show error message in device.

It is not shown in logcat.

Here’s my code:

LocationManager myManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE);
if(myManager != null){
    String param=(String)myManager.getProviders(true).get(0);
    Location loc = myManager.getLastKnownLocation(param);

    if(loc != null){
         ............
    } else {
         Log.e("AndroidMaps-1 ","Error: Location  is null");
         builder.setMessage("err").setPositiveButton("Yes",dialogClickListener).show();
    }   
} else {
    Log.e("AndroidMaps-2 ","Error: Location Manager is null");
    builder.setMessage("Are you sure").setPositiveButton("Yes",dialogClickListener).show();
}

when wi-fi is turned off I do not get any error message from logcat or dialog box.

  • 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-05-21T06:55:12+00:00Added an answer on May 21, 2026 at 6:55 am

    Before doing anything else, you could check for Internet connectivity. If no Internet connection is available, you could notify the user.

    Although, in my applications, it doesn’t crash when the Map tries to lead tiles without any Internet connection.

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

Sidebar

Related Questions

How to create a windows registry watcher application using .Net, I want this application
I want to create a new business application using the Django framework. Any suggestions
i'm using google maps v3 and i want create a new map associate to
I m using map in my application. How to create a custom annotation in
I needed to create an application using Struts2 as MVC,Hibernate for data access and
How do you create a desktop application using C# that would look like Visual
I need to create a web application using php, I had many users having
I need to create a web application using ASP.NET MVC, jQuery and web standards
I'm trying to create a web application using maven, tomcat and hibernate. Now I'm
I am trying to create my first GUI application using (Java + Eclipse +

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.