Resource not found Row resource identifier

I am creating an application in which there are 2 Android projects; The first project is the library project, and the second project is my main project. Project-1 works fine, but when I add it to my Project-2 as a library, it gives me exceptions like this. The resource was not found. Line Resource Identifier # 0x76000456

when I checked my rowset and R.java this line is.

I tried to execute a clean project by rebooting my eclipse and my system.

The file my strings.xml looks like this: -

<string name="pref_loadrecent_id">loadrecent</string> <string name="pref_loadrecent_defvalue">false</string> <string name="pref_confirmclose_id">confirmclose</string> <string name="pref_confirmclose_defvalue">false</string> 

and I call like this: -

 BooleanPreferenceDefinition LOAD_RECENT = new BooleanPreferenceDefinition(pref_loadrecent_id, pref_loadrecent_defvalue); BooleanPreferenceDefinition CONFIRM_CLOSE = new BooleanPreferenceDefinition(pref_confirmclose_id, pref_confirmclose_defvalue); 

and I am doing a static import R.string like this

 import static com.ankit.R.string.*; 

For testing, instead of calling the hard code values pref_loadrecent_id and pref_loadrecent_defvalue from the string identifier, it shows a similar exception (with a different identifier) ​​for pref_confirmclose_id and pref_confirmclose_defvalue .

Please help me.

0
source share
4 answers

The parameter you pass in for the response cannot be converted to a string ... first convert it to a string, then pass this string parameter for the correct answer.

eg..

 @Override public void onClick(View v) { // TODO Auto-generated method stub EditText edittext = (EditText) findViewById(R.id.edT); String str = edittext.getText().toString(); int n = Integer.parseInt(str); int fact = n , i ,e; e = n; if (n==0) fact = 1; else for(i=0; i<n-1; i++) { fact = fact * (e - 1); e = e - 1; } String str1 = String.valueOf(fact); <-----//Your mistake maybe here..... Toast.makeText(getApplicationContext(), str1, Toast.LENGTH_LONG).show(); } 
+2
source

Whenever you find any problem in the resource ID, then go to project -> Clear

And clean your project, the R.java file will be created again .

0
source

Make, correct the project properties and clean the project. Close eclipse and run it again. He will be allowed.

0
source

I may be wrong, but it seems to me that you only import int not Strings with

 import static com.ankit.R.string.*; 

And this may be the reason for your exclusion. The resource was not found. Row Resource Identifier ...

0
source

Source: https://habr.com/ru/post/950237/


All Articles