Android hardware acceleration problems and errors

Source: Internet
Author: User

The program recently encountered some strange problems: the source is unknown, and only a problem occurs for a specific model. If you have met, consider whether or notHardware acceleration(Hardware Acceleration) Error

Since Android3.0 (API level 11), the Android 2D display pipeline has been designed to support Hard acceleration. hard acceleration uses GPU to perform all the painting operations on the View canvas.

Hardware acceleration is a good thing. It can make the sliding of ListView and WebView smoother, but it will always cause inexplicable problems.

Question 1: Text overlapping in EditText

 

This is a problem that I solved in my previous blog, see: http://blog.csdn.net/icyfox_bupt/article/details/12837093

In some 4.x machines, if hardware acceleration is enabled, EditText may have strange overlapping texts.

 

Solution: Disable hardware acceleration for EditText.

 

Problem 2: The image cannot be displayed.

You may need to load a large image in the program, but OpenGL in hardware acceleration imposes limitations on memory. If this restriction is met, LogCat will only report a Warning: Bitmap too large to be uploaded into a texture (587x7696, max = 2048x2048)

In this case, we need to disable hardware acceleration.

But at first I handled it like this. I disabled the hardware acceleration for the entire application:

 

    

Then I found that although the image can be displayed, the ListView, WebView and other controls appear special cards, which shows that hardware acceleration significantly improves program performance. So I will close the Activity.

 

 

In this way, the problem is well solved. In fact, we can also control whether each control is accelerated.

 

The purpose of this article is to help you think about this when you encounter some strange problems.

 

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.