Android common error handling (2) and android common error handling

Source: Internet
Author: User

Android common error handling (2) and android common error handling

The test month is very busy. After the test, you can continue to write code and learn more ...... I hope you will give me more advice ~


1. java. lang. OutOfMemoryError


2. Images cannot be filled with ImageView

This solution is actually quite simple. Use the setScaleType () method of ImageView and select fitXY as the parameter .. If the image is distorted, The centerCrop parameter is used.


3. RuntimeError: You cannot combine custom titles with other title features

This error means that you cannot mix multiple title styles. There are several solutions:


Iv. Jar mismatch! Fix your depedenciesMost of the errors occur when multiple packages are imported to a project. The main cause is that different packages may use different jar packages. Take me for example:
I used library1, library2, And the android-support-v4.jar of the project itself, and this error occurs, saying that I have three packages and cannot identify which one to use. The solution is to unify the jar of the three packages, so there is such an approach on the Internet:
Replace all the jar files in the library with the jar files of the project. But I think another method on StackOverflow is better:
First use the Add Support Library in Android Tools for your project, and then remove all the android-support-v4.jar, add external jar to the build path menu for each Project or Library, or choose Project Properties> Android> Library> Add... to ensure the consistency of the package.
V. ClassNotFoundException
This error may be because the package is not completely imported. It may be because the class name to be started is not written on AndroidManifest.

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.