Skip to content

Instantly share code, notes, and snippets.

@anthonykeane
Created September 25, 2013 09:05
Show Gist options
  • Select an option

  • Save anthonykeane/6696991 to your computer and use it in GitHub Desktop.

Select an option

Save anthonykeane/6696991 to your computer and use it in GitHub Desktop.
Very cool pointer to pointer in java Android
int i = getArguments().getInt(ARG_PLANET_NUMBER);
String planet = getResources().getStringArray(R.array.planets_array)[i];
int imageId = getResources().getIdentifier(planet.toLowerCase(Locale.getDefault()),
"drawable", getActivity().getPackageName());
((ImageView) rootView.findViewById(R.id.image)).setImageResource(imageId);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment