Please nominate your Qt Champions for 2021!

Change native android selection handles

  • Hi,

    as of Qt 5.8, it's now possible to select text with the native android selection handles. (see ). Now I would like to exchange the default Android selection handles

    alt text alt text
    alt text

    with the material design selection handles. Therefore, I copied the material design selection handles to my drawablefolder and created a custom apptheme.xml with the following content:

    <?xml version="1.0" encoding="utf-8"?>
        <style name="AppTheme" parent="@android:style/Theme.Holo.Light.NoActionBar">
            <item name="android:textSelectHandle">@drawable/text_select_handle_middle</item>
            <item name="android:textSelectHandleLeft">@drawable/text_select_handle_left</item>
            <item name="android:textSelectHandleRight">@drawable/text_select_handle_right</item>

    In my AndroidManifest.xml I reference the custom style with


    However, the style of the selection handles doesn't change. Anybody an idea what I am doing wrong?

  • Just encountered a same issue myself and manage to stumble upon a solution after a long period of searching barely documented android docs. Anyways, for some reason, the theme is not read from the AndroidManifext.xml, not in this case anyways. So to solve it, you have to manually load your theme file in Activity's onCreate() method like so:

    public void onCreate(Bundle savedInstanceState) {
        // rest of the code ...

Log in to reply