With new android API 22 getResources().getDrawable() is now deprecated. Now the best approach is to use only getDrawable().
getResources().getDrawable()
getDrawable()
What changed? <
en api level 14
marker.setIcon(ResourcesCompat.getDrawable(getResources(), R.drawable.miubicacion, null));