Ashwin Kmr

Ashwin Kmr

  • NA
  • 320
  • 82.1k

Resource id value is 0 only for jpeg images in android

Sep 26 2018 11:28 PM
Hi all,
 
I have been working in a project in that i need to get the resource id from its name of a image (png/jpg) located inside the dawable folder of android project
 
I have used the below code to retrieve the resource id,
 
  Resources resources = this.Resources;

  int resourceId = resources.GetIdentifier("Buldingimage", "drawable",
                                                     this.PackageName);  // for jpeg images returning only 0

The above code is working fine for all png image but when coming to jpeg images it is always returning 0.
  
 
Please help me on this.
 
Thanks in advance,
 Ashwin 

Answers (1)