Common mistakes in Android development

Source: Internet
Author: User

E/trace (28187): Error opening Trace file:no such file or directory (2)

Error reason: The Android API version and emulator version are inconsistent and have no impact on development.

android.content.res.resources$notfoundexception:string Resource ID #0x36

Error reason: Generally occurs in the parameter int resid error, the string is assigned to the resid of int, so the compiler can not find the correct resource error. Check for functions such as Toast.maketext (), textview.settext, which typically have several overloads, such as:

Textview.settext (charsequence text);

Textview.settext (int resId);

......

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

Solution: Example: Count.settext (Incall.getcount ()); modified to: Count.settext (string.valueof (Incall.getcount ())); or Count.settext (Incall.getcount () + ""); .

Common mistakes in Android development

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.