Note that there are some explanatory texts on larger screens.

plurals
  1. POgetting null on current location on Samsung Galaxy Grand android?
    primarykey
    data
    text
    <p>I'm try to run my app on Samsung Galaxy Grand but its not showing my current location.</p> <pre><code> locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); // Creating a criteria object to retrieve provider Criteria criteria = new Criteria(); // Getting the name of the best provider String provider = locationManager.getBestProvider(criteria, true); System.out.println("provider =&gt; " + provider); // Getting Current Location Location location = locationManager.getLastKnownLocation(provider); System.out.println("location " + location); </code></pre> <p>but always this line return null <strong>locationManager.getLastKnownLocation(provider);</strong> but this app works fine in other phones like <strong>sony and lg</strong>.</p> <p>i have try so many link but still same problem.</p> <p><a href="https://stackoverflow.com/questions/12894162/getlastknownlocation-always-returning-null-all-providers-are-dummylocationpro">getLastKnownLocation() always returning null, all providers are DummyLocationProvider</a></p> <p><a href="https://stackoverflow.com/questions/1608632/android-locationmanager-getlastknownlocation-returns-null">Android LocationManager.getLastKnownLocation() returns null</a></p> <p><a href="https://stackoverflow.com/questions/12597076/network-provider-and-gps-provider-returning-null-values">Network provider and GPS provider returning null values</a></p> <p><strong>permission</strong></p> <pre><code>&lt;permission android:name="xx.xxx.xxx.permission.MAPS_RECEIVE" android:protectionLevel="signature" /&gt; &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /&gt; &lt;uses-permission android:name="xicom.biz.perdiem.permission.MAPS_RECEIVE" /&gt; &lt;uses-permission android:name="android.permission.INTERNET" /&gt; &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt; &lt;uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" /&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.WRITE_INTERNAL_STORAGE" /&gt; &lt;uses-feature android:glEsVersion="0x00020000" android:required="true" /&gt; &lt;application android:label="@string/app_name" &gt; &lt;meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="AIzaSyccccccccbvxcbpmFLAZwalBGM" /&gt; ...... </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.
 

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