Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7794043
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T22:40:45+00:00 2026-06-01T22:40:45+00:00

I have hardware acceleration enabled in my app but I have disabled it for

  • 0

I have hardware acceleration enabled in my app but I have disabled it for one of my views because I had problems with stroke caps and other things.

Now I’m getting this stack trace in the Google Play Crash Errors console:

java.lang.UnsupportedOperationException
at android.view.GLES20Canvas.clipPath(GLES20Canvas.java:287)
at com.myapp.MyCustomView.onDraw(SourceFile:288)
at android.view.View.draw(View.java:9310)
at android.view.View.getDisplayList(View.java:8773)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:2298)
...
at android.view.HardwareRenderer$GlRenderer.draw(HardwareRenderer.java:609)
at android.view.ViewRoot.draw(ViewRoot.java:1634)
at android.view.ViewRoot.performTraversals(ViewRoot.java:1450)
at android.view.ViewRoot.handleMessage(ViewRoot.java:2094)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:132)
at android.app.ActivityThread.main(ActivityThread.java:4123)
...

I have specified android:hardwareAccelerated="true" in AndroidManifest.xml. But I specifically disabled hardware acceleration in the constructor of my custom view:

    public MyCustomView(Context context, AttributeSet attrs, int defStyle) {
            super(context, attrs, defStyle);

            // ... code omitted

            // disable acceleration because Paint.setStrokeCap(Cap.ROUND) is not working otherwise
            Compatibility.disableHardwareAcceleration(this);
    }

With compatibility being this:

public class Compatibility {
        // View.setLayerType() was introduced in Honeycomb
        private static Method setLayerTypeMethod = getMethod(View.class, "setLayerType", int.class,
                        Paint.class);

        private static Method getMethod(Class<?> clazz, String name, Class<?>... parameterTypes) {
                try {
                        return clazz.getMethod(name, parameterTypes);
                }
                catch (NoSuchMethodException e) {
                        return null;
                }
        }

        private Compatibility() {
        }

        public static void disableHardwareAcceleration(View view) {
                try {
                        if (setLayerTypeMethod != null) {
                                int layerType = 1; // View.LAYER_TYPE_SOFTWARE
                                setLayerTypeMethod.invoke(view, layerType, null);
                        }
                }
                catch (Exception ignored) {
                }
        }
}

Unfortunately the Crash Errors console does not reveal information about the Android OS version or device.

Any ideas what might be going on?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T22:40:46+00:00Added an answer on June 1, 2026 at 10:40 pm

    There is a know issue where a view is still drawn using hardware acceleration even if LAYER_TYPE_SOFTWARE was set. Details are here

    As a workaround you can do two things

    1. use Canvas.isHardwareAccelerated() to skip the problematic code.
    2. draw the problematic stuff into a bitmap and and draw this with canvas.drawBitmap() onto the hardware accelerated view.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My app uses Canvas methods which are not supported by hardware acceleration (clipPath, drawPicture),
How do I decode a file with hardware acceleration with ffmpeg? I have written
Probably something silly going on, but I am trying to enable hardware acceleration in
i have a hardware token for remote login to some citrix environment. When i
I have to make a hardware project using a microcontroller, memory, screens, etc. Is
I have a project that involves polling a hardware switch each update and converting
I have some Linux code that monitors our hardware by collecting temperatures, voltages, and
Question I have two compilers on my hardware C++ and C89 I'm thinking about
I have two essentially separate applications for configuring two pieces of hardware sold by
I have long file with the following list: /drivers/isdn/hardware/eicon/message.c//add_b1() /drivers/media/video/saa7134/saa7134-dvb.c//dvb_init() /sound/pci/ac97/ac97_codec.c//snd_ac97_mixer_build() /drivers/s390/char/tape_34xx.c//tape_34xx_unit_check() (PROBLEM)/drivers/video/sis/init301.c//SiS_GetCRT2Data301() /drivers/scsi/sg.c//sg_ioctl()

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.