Suppose I have code like this:
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_msmap);
setUpMapIfNeeded();
if (mMap == null) {
return;
}
Before I start the activity I have checked google maps libraries are available. However, if there is no sim card / internet connectivity mMap still returns null.
One would think this works since the Google maps / Google play actually shows an error with "not available" with an OK button. But if one clicks it, the app hangs...
So rather, when mMap == null, I would like to simply exit the activity constructor showing an error, and then return to the prior activity. Is there any way to do that gracefully in some way?