Skip to content

Instantly share code, notes, and snippets.

@bleege
Created February 1, 2014 22:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bleege/8760232 to your computer and use it in GitHub Desktop.
Save bleege/8760232 to your computer and use it in GitHub Desktop.
Android Resource Loading Models Comparison
From Marker.java
/**
* Set this marker's icon to a marker from the Maki icon set.
*
* @param makiString the name of a Maki icon symbol
*/
public void fromMaki(String makiString) {
String urlString = "/com/mapbox/" + makiString+"182x";
logger.info("urlString = '" + urlString + "'");
Drawable drawable = mResourceProxy.getMapBoxDrawable(urlString);
logger.info("drawable = '" + drawable + "'");
this.setMarker(drawable);
/*
String urlString = makiString+"182x";
int id = context.getResources().getIdentifier(urlString, "drawable", context.getPackageName());
this.setMarker(context.getResources().getDrawable(id));
*/
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment