Android notes, android learning notes

Source: Internet
Author: User

Android notes, android learning notes

1. Do not pass the int value to the setText function of the textview control, because when you pass the int type, it will assume that it is a resource id.

The following error is reported: java. lang. runtimeException: Unable to start activity ComponentInfo {com. example. ndktest/com. example. ndktest. mainActivity}: android. content. res. resources $ NotFoundException: Unable to find resource ID #0x4

Note that the last 4 is actually the value that I want to pass to the setText function.


2. java. lang. UnsatisfiedLinkError: Native method not found two possible solutions

A. Jni method header case sensitivity problem: in C ++, the method name is Java_com_XXX instead of java_com_XXX. We recommend that you directly copy the method name from the generated. h header file to the C or C ++ file.

B. C ++ file problem: if it is a C ++ file (. cpp or. cc), use extern "C" {} to include the local method.

Related Article

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.