Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android resource not found exception?

Tags:

java

android

I am having a strange problem using findViewById(id). It comes back with resource not found even though the resource is definitely there. It is a textview in a layout next to another textview, one of the textviews I can find by id but the other shows resource not found. Is there any reason this might be happening?

like image 863
Bobbake4 Avatar asked Oct 11 '11 14:10

Bobbake4


People also ask

What is resource not found exception?

This exception is thrown by the resource APIs when a requested resource can not be found.

What is Android Studio exception?

An exception thrown by AppSearchSession or a subcomponent. BackingStoreException. Thrown to indicate that a preferences operation could not complete because of a failure in the backing store, or a failure to contact the backing store.


2 Answers

Make sure that you aren't really just trying to set the text to a number and expecting it to automatically convert to a string.

like image 147
Terra Caines Avatar answered Oct 12 '22 13:10

Terra Caines


Try cleaning your project or post some code.

Sometimes the ID's do not get correctly regenerated if you are using Eclipse. This requires the project to be cleaned and sometimes refreshed.

like image 39
Mike dg Avatar answered Oct 12 '22 11:10

Mike dg