Exception handling android.content.res.resources$notfoundexception:string Resource ID #0x44

Source: Internet
Author: User

Error: android.content.res.resources$notfoundexception:string resource ID #0x1

Cause: Generally occurs in the parameter int resId error, you assign string to int's resId, so the compiler can not find the correct resource then error.

In the simplest case, check your toast.maketext () Ah textview.settext. Functions, which typically have several overloads, such as:

Textview.settext (charsequence text);

Textview.settext (int resId);

......

If you accidentally pass an int value to it, then it will not show the int value, but run to the project to find a corresponding resource ID, of course, is not found, so the error.

Workaround:

If you want to display the int value, convert int to string or charsequence, there are many ways on Baidu.

Personally prefer to do this: after the int value + "", Force to string. Easy to use. ╮ (╯_╰) ╭

Exception handling android.content.res.resources$notfoundexception:string Resource ID #0x44

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.