Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Problem seems to be solved. In onCreate, I added:</p> <pre><code>Criteria crit = new Criteria(); crit.setAccuracy(Criteria.ACCURACY_FINE); best = mgr.getBestProvider(crit, false); mgr.requestLocationUpdates(best, 0, 1, locationListener); </code></pre> <p>onLocationChanged now looks like that:</p> <pre><code>@Override public void onLocationChanged(Location location) { i++; nextPoint = overlay.getMyLocation(); latitude = nextPoint.getLatitudeE6(); longtitude = nextPoint.getLongitudeE6(); lastPoint = new GeoPoint((int) latitude, (int) longtitude); Points.add(lastPoint); MapOverlay mapOverlay = new MapOverlay(Points.get(i - 1), Points.get(i)); map.getOverlays().add(mapOverlay); mMapController.animateTo(Points.get(i)); nextPoint = null; lastPoint = null; } </code></pre> <p>Also, very important methods:</p> <pre><code>@Override protected void onResume() { super.onResume(); mgr.requestLocationUpdates(best, 10000, 1, locationListener); } @Override protected void onPause() { super.onPause(); mgr.removeUpdates(locationListener); } </code></pre> <p>And also some new permissions:</p> <pre><code>&lt;uses-permission android:name="android.permission.ACCESS_GPS" /&gt; &lt;uses-permission android:name="android.permission.ACCESS_LOCATION" /&gt; &lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /&gt; &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /&gt; &lt;uses-permission android:name="android.permission.INTERNET" /&gt; </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.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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