Skip to content

Instantly share code, notes, and snippets.

View MuhammadRabeet's full-sized avatar

MuhammadRabeet

View GitHub Profile
@talhahasanzia
talhahasanzia / GetLocation.java
Created July 15, 2016 05:43
Get best location from any of the location providers that are available.
private Location getLastKnownLocation() {
// get location from any of the location providers that are available
locMan = (LocationManager) getActivity().getSystemService(getActivity().LOCATION_SERVICE);
List<String> providers = locMan.getProviders(true);
Location bestLocation = null;
// check for all providers
for (String provider : providers) {
Location l = locMan.getLastKnownLocation(provider);
package com.example.android.waitlist;
import android.content.Context;
import android.database.Cursor;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;