Skip to content

Instantly share code, notes, and snippets.

Created May 15, 2014 16:35
Show Gist options
  • Save anonymous/ea1e424b91c2c2814b22 to your computer and use it in GitHub Desktop.
Save anonymous/ea1e424b91c2c2814b22 to your computer and use it in GitHub Desktop.
/**
* Created by Mike on 3/17/14.
*/
public class BreweryMap extends Fragment {
public BreweryMap(){}
String beerId = "";
GoogleMap mMap;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.activity_brewmap, container, false);
setHasOptionsMenu(true);
//get user information
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getActivity());
String userName = prefs.getString("userName", null);
String userID = prefs.getString("userID", null);
mMap = ((SupportMapFragment) getFragmentManager().findFragmentById(R.id.map)).getMap();
mMap.clear();
//add url
String url = "myURL";
//call async to get breweries to add to
new GetVisitedBreweries(getActivity(), mMap).execute(url);
return rootView;
}
@Override
public void onResume() {
super.onResume();
if (mMap == null) {
mMap.addMarker(new MarkerOptions().position(new LatLng(0, 0)));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment