Skip to content Skip to sidebar Skip to footer

Resource Not Found String Resource Id

I am making an which app which have 2 android project; 1st project is library project and 2nd project is my main project. project-1 is working fine but when I am adding it in my Pr

Solution 1:

The parameter which you are passing for your answer might not converted into string ... first convert it into string then pass that string parameter for correct answer..

for example..

@OverridepublicvoidonClick(View v) {

// TODO Auto-generated method stubEditTextedittext= (EditText) findViewById(R.id.edT);

    Stringstr= edittext.getText().toString();

    intn= Integer.parseInt(str);

    intfact= n , i ,e;

    e = n;

    if (n==0)
    fact = 1;

    elsefor(i=0; i<n-1; i++)
        {
            fact = fact * (e - 1);
            e = e - 1;

        }


Stringstr1= String.valueOf(fact);       <-----//Your mistake maybe here.....

Toast.makeText(getApplicationContext(), str1, Toast.LENGTH_LONG).show();

                }

Solution 2:

Whenever you find any Problem in Resource ID then Go To Project-->Clean

And clean your project, R.java file will be generated Again.

Solution 3:

Do, fix project properties and clean the project. Close eclipse and restart it again. It will be resolved.

Solution 4:

Maybe I'm wrong but to me it looks as if you're importing only int not Strings with

importstatic com.ankit.R.string.*;

And that could be the reason for your exception Resource not found String resource ID #...

Solution 5:

In my case, I casted the int value to string value and it was solved

String s = String.valueOf([int value]);

Post a Comment for "Resource Not Found String Resource Id"