Problem in OpenGLRenderer: the path is too long to display the texture

I have a TextView inside a ReleativeLayout in which I set the large text to this at runtime. The problem is with my ReleativeLayout background, which is a rounded shape with a border. it does not set the background, but in Logcat it says that:

 12-12 16:26:56.602: W/OpenGLRenderer(7400): Path too large to be rendered into a texture 

I solved this problem by turning android: hardwareAccelerated to false in the manifest file (one action is not the whole application), but it causes another error when I use the sliding menu inside my Activity, which it reports that:

 12-12 16:37:05.717: E/AndroidRuntime(9520): java.lang.RuntimeException: Canvas: trying to use a recycled bitmap android.graphics.Bitmap@4633e3f8 

I only have a ListView without any bitmaps inside my SlidingMenu, which is the SlidingLayer 6Wunderkinder library.

Any help would be appreciated.

+6
source share
3 answers

Finally, this resolved this by simply changing the LayerType of my ScrollView Fragment from HardwareAcceleration to Software without setting HardwareAcceleration false for all activity that caused strange behavior, as mentioned in SlidingMenu:

 <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:layerType="software"> 
+14
source

This happens to me when I have a scroll that is too long, with the ability to draw in root mode, it affects each device uniquely. My Nexus 9 will show the most, but my sony compact will not. You should not turn off hardware acceleration because on low-maintenance devices you will likely have a very volatile application.

In this situation, you should probably consider using a list or recyclerview to ensure that your background element is no larger than the screen. Even XML images in the background of a not-so-long scrollview will generate this error. I choose for security and redesign elements, making it easier to remove the background from the scroll, maybe options, and put them like tiles in internal elements.

It seems strange, but this should be due to the way the background is created by this root view in a longer scroll, because the scrollview itself can be quite long, with many complex elements without problems and background colors are never a problem ..

+3
source

If you want to do this programmatically, you can install:

 view.setLayerType(View.LAYER_TYPE_SOFTWARE, null); 
+1
source

Source: https://habr.com/ru/post/979503/


All Articles