• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Get drawable name from image adapter?

Budisha

Lurker
Hello.

Im making an app in which the user selects an image and then gets redirected to a new screen in which the drawable name is displayed.

This is the code triggered when the user click an image:
Code:
public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
    Intent tabsIntent = new Intent();
    tabsIntent.setClassName("com.budisha.app", "com.budisha.app.TabClassActivity");
    tabsIntent.putExtra("pic_name", position);  //sends picture position
    startActivity(tabsIntent);
}

This sends the new activity the drawable position. But i need to get the drawable name.
Is there any way to do this? If yes, can you help me?

Sorry if I'm posting in the wrong section. Im new to this forum
 
Hello.
Thank you for the reply, but your post didnt help me.
Your code returned "app_name".
Bur your answer helped me to figure the solution.
This is my code:
Code:
getResources().getResourceEntryName(2130837508 + position)

2130837508 is the first picture.
 
Back
Top Bottom