未找到资源字符串资源ID [英] Resource not found String resource ID

查看:405
本文介绍了未找到资源字符串资源ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在做这有2个Android项目的哪个应用;第一个项目是库工程和二期工程是我的主要项目。项目-1工作正常,但是当我在我的项目-2将其添加为库它给我这样的例外
未找到资源字符串资源ID#0x76000456

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 Project-2 as library it is giving me exceptions like this Resource not found String resource ID #0x76000456

当我检查我的字符串包和R.java这个字符串是存在的。

when i checked my string bundle and R.java this string is there.

我试图清理项目重新启动Eclipse和我的系统。

I have tried clean Project restart my eclipse and my system.

我的strings.xml文件看起来像: -

my strings.xml file looks like:-

 <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 am calling like this:-

BooleanPreferenceDefinition LOAD_RECENT = new BooleanPreferenceDefinition(pref_loadrecent_id,
        pref_loadrecent_defvalue);

BooleanPreferenceDefinition CONFIRM_CLOSE = new BooleanPreferenceDefinition(pref_confirmclose_id,
        pref_confirmclose_defvalue);

和我做这样的R.string的静态导入

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

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

有关测试,而不是从字符串ID叫我很难code的值 pref_loadrecent_id pref_loadrecent_defvalue 那么它显示了类似的异常(用不同的ID) pref_confirmclose_id pref_confirmclose_defvalue

For testing instead of calling from string id i hard code the values of pref_loadrecent_id and pref_loadrecent_defvalue then it is showing similar exception(with different ID) for pref_confirmclose_id and pref_confirmclose_defvalue.

请帮助我。

推荐答案

你所传递的回答参数可能无法转换成字符串...
先将其转换为字符串,然后传递正确答案字符串参数。

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..

例如..

@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();

                }

这篇关于未找到资源字符串资源ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆