android.content.res.resources $ notfoundexception string resource id#0x0

时间:2013-04-25 10:11:16

标签: android

当我试图通过从另一个类调用构造函数来获取表中的数据列表时,我收到此错误, 我的主要文件是

Account.java

            try{
                List<PersonalInformation> temp = helper.findAll();
                Toast.makeText(getApplicationContext(), temp.size(), Toast.LENGTH_LONG).show();
                }
                catch (Exception e) {
                    Toast.makeText(getApplicationContext(), e+"", Toast.LENGTH_LONG).show();

                }

1 个答案:

答案 0 :(得分:10)

更改

Toast.makeText(getApplicationContext(), temp.size(), Toast.LENGTH_LONG).show();

Toast.makeText(getApplicationContext(), String.valueOf(temp.size()), Toast.LENGTH_LONG).show();