Note that there are some explanatory texts on larger screens.

plurals
  1. POonResume() without calling setupWebView() after retuning from Activity
    primarykey
    data
    text
    <p>I'm trying to implement returning from an Activity without needing to refresh the screen. As far as I see, there are 4 possible states to handle:</p> <ol> <li>Both "Use wireless networks" and "Use GPS satellites" are disabled (user is directed to My Location preferences and not allowed to continue if either are are disabled)</li> <li>One of these two are enabled (1 of 2 possibilities) 3, Both are enabled</li> </ol> <p>My problem is that after returning from other Activities in my app, setupWebView() is called every time causing a screen refresh delay.</p> <p>The refresh is somewhat necessary returning from the preferences (e.g. GPS after enabling gets a fix), but certainly not after returning from an Activity as the time delay in re-painting the screen is distracting and slows down the workflow of my app.</p> <p>Could someone please advise how to handle this within my onResume() so to avoid all the setupWebview calls.</p> <p>Here is the code from my onResume() within my main Activity:</p> <pre><code> @Override protected void onResume() { if (!locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER) &amp;&amp; !locationManager .isProviderEnabled(LocationManager.NETWORK_PROVIDER)) createMyLocationDisabledAlert(); if (locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)) { locationManager.requestLocationUpdates( LocationManager.GPS_PROVIDER, 500, 0, this); mostRecentLocation = locationManager .getLastKnownLocation(LocationManager.GPS_PROVIDER); if (mostRecentLocation != null) setupWebView(); else { mostRecentLocation = locationManager .getLastKnownLocation(LocationManager.NETWORK_PROVIDER); setupWebView(); } } else if (locationManager .isProviderEnabled(LocationManager.NETWORK_PROVIDER)) { locationManager.requestLocationUpdates( LocationManager.NETWORK_PROVIDER, 500, 0, this); mostRecentLocation = locationManager .getLastKnownLocation(LocationManager.NETWORK_PROVIDER); if (mostRecentLocation != null) setupWebView(); else { mostRecentLocation = locationManager .getLastKnownLocation(LocationManager.NETWORK_PROVIDER); setupWebView(); } } // locationManager.requestLocationUpdates(provider, 500, 0, this); // mostRecentLocation = locationManager.getLastKnownLocation(provider); // } else // mostRecentLocation = locationManager // .getLastKnownLocation(LocationManager.NETWORK_PROVIDER); super.onResume(); } </code></pre>
    singulars
    1. This table or related slice is empty.
    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.
    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