-
-
Save anonymous/ea1e424b91c2c2814b22 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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