Android resource not found exception?

前端 未结 9 616
一生所求
一生所求 2020-11-28 12:11

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 t

相关标签:
9条回答
  • 2020-11-28 13:10

    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.

    0 讨论(0)
  • 2020-11-28 13:12

    textViewCount.setText(someArray.size()); was my problem.

    Simply call toString(); to fix the problem.

        Integer size = mSomeArray.size();
        textViewReplyCount.setText(size.toString());
    
    0 讨论(0)
  • 2020-11-28 13:16

    In my case, I had int variable (on top of my Activity class) and I was trying to pass that int variable as second parameter to Toast.makeText() (to show that to the user), I don't know I was stupid or android dev platform is! :p

    0 讨论(0)
提交回复
热议问题