Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid:MapActivity is giving Nullpointerexception
    primarykey
    data
    text
    <p>when i first load my app mapActivity is invoking and i can see the map, now when i switch off the networkconnectivity and on again , changing the screen and coming back to the mapactivity the map is showing null, getting nullpointer exception at this line new <code>MapUtils().drawMap(this);</code> in <code>onResume()</code> method.</p> <pre><code>@Override protected void onResume() { Utils utils = new Utils(); manager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); listener = new ManageLocation(); listener.setSucessCallBack(this, "setLocation"); listener.setFailureCallBack(this, "setNoLocation"); manager.requestLocationUpdates( utils.getCurrentPlaceLocationProvider(manager), 0, 0, listener); super.onResume(); Log.d(TAG, "Constants.isDataLoadedPAB " + Constants.isMaptobeLoaded + " Constants.isDataLoadedPAB : " + Constants.isDataLoadedPAB); if (Constants.isMaptobeLoaded) { if (Constants.isDataLoadedPAB) { try { new MapUtils().drawMap(this); } catch (Exception e) { Log.e(TAG, "Error", e); } } else { if (Constants.currentLocation != null &amp;&amp; Constants.searchLocation != null) { if (Constants.searchResultData == null) { Constants.searchResultData = new ArrayList&lt;AttractionData&gt;(); } new MapUtils().drawMap(this); } } } ((ImageView) activity.findViewById(R.id.left)).setEnabled(true); ((ImageView) activity.findViewById(R.id.right)).setEnabled(true); ((ImageView) findViewById(R.id.searchicon)).setEnabled(true); ((ImageView) activity.findViewById(R.id.facebookintegration)).setEnabled(true); } </code></pre> <p>I am trying to invoke it again in <code>onResume()</code> but still getting null. i am struck not sure where i am doing wrong.Any help is appreciated</p> <p>my log </p> <pre><code>01-29 11:23:36.325: E/AndroidRuntime(6668): Caused by: java.lang.NullPointerException 01-29 11:23:36.325: E/AndroidRuntime(6668): at org.appright.myneighborhood.maps.MapUtils.drawMap(MapUtils.java:59) 01-29 11:23:36.325: E/AndroidRuntime(6668): at org.appright.myneighborhood.activity.CityAttractions.onResume(CityAttractions.java:505) 01-29 11:23:36.325: E/AndroidRuntime(6668): at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1199) 01-29 11:23:36.325: E/AndroidRuntime(6668): at android.app.Activity.performResume(Activity.java:5280) 01-29 11:23:36.325: E/AndroidRuntime(6668): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2606) 01-29 11:23:36.325: E/AndroidRuntime(6668): ... 10 more </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload