Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>t0mm13b, working on my handset but GPS notification icon not blinking. Virtual Device means Emulator. I solved problem. </p> <p>Code : </p> <pre><code>package com.yunusoksuz.gmapstest; import android.app.Activity; import android.location.Criteria; import android.location.Location; import android.location.LocationListener; import android.location.LocationManager; import android.os.Bundle; import android.widget.TextView; import android.widget.Toast; public class YnsmapsActivity extends Activity implements LocationListener { /** Called when the activity is first created. */ private LocationManager locationManager; private Location location; private String provider; private Double lat, longi; private Criteria criteria; TextView tv; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); tv = (TextView) findViewById(R.id.tv1); locationManager = (LocationManager) getSystemService(LOCATION_SERVICE); criteria = new Criteria(); criteria.setAccuracy(Criteria.ACCURACY_FINE); criteria.setAccuracy(Criteria.ACCURACY_COARSE); provider = locationManager.getBestProvider(criteria, false); location = locationManager.getLastKnownLocation(provider); locationManager.requestLocationUpdates(provider, 0, 0, this); } public void onLocationChanged(Location location) { Toast.makeText( this, "Lat : " + location.getLatitude() + " LONG : " + location.getLongitude(), Toast.LENGTH_SHORT).show(); tv.setText("Lat : " + location.getLatitude() + " LONG : " + location.getLongitude()); } public void onProviderDisabled(String provider) { // TODO Auto-generated method stub } public void onProviderEnabled(String provider) { // TODO Auto-generated method stub } public void onStatusChanged(String provider, int status, Bundle extras) { // TODO Auto-generated method stub } @Override protected void onPause() { // TODO Auto-generated method stub super.onPause(); locationManager.removeUpdates(this); } @Override protected void onResume() { // TODO Auto-generated method stub super.onResume(); locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, this); } } </code></pre> <p>Now gps notification blinking.</p>
    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. VO
      singulars
      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