I have a few EditText fields in the same XML layout file, I’m using this code but it returns 0 as the id for every EditText field. Could somebody please tell me what I’m doing wrong?
String resName = "page1entry1";
int resID = resources.getIdentifier(resName, "layout", "mfc.generalgui2");
resName is the string id of my EditText field.
I think the problem is that you’re using the wrong label for the second parameter. It should be this, if you’re retrieving an EditText by id: