[Android-development] Hide Android selection handles manually

Юрий Лунёв yury at indigosystem.ru
Thu Feb 9 05:29:12 CET 2017


I am almost completely sure that Qt cursor has no connection to Android system cursor. I think, it is better to spend time researching how cursor is done in Qt sources.

> 8 февр. 2017 г., в 23:37, Bernhard B <schluchti at gmail.com> написал(а):
> 
> Hi,
> 
> i tried a few things today, but unfortunately I couldn't make it work. 
> 
> I implemented the following static method which should get the cursor handle: 
> 
> public static void hideCursorHandle(){
>     QtActivityDelegate activityDelegate = QtNative.activityDelegate();
>   try{
>       Field f = activityDelegate.getClass().getDeclaredField("m_cursorHandle");
>       f.setAccessible(true);
>       try{
>           CursorHandle cursorHandle = (CursorHandle) f.get(activityDelegate);
>           cursorHandle.hide();
>           Log.i(TAG, "hide");
>       } catch(IllegalAccessException e1){
>           Log.e(TAG, "IllegalAccessException");
>       }
>   } catch(NoSuchFieldException e){
>       Log.e(TAG, "NoSuchFieldException");
>   }
> }
> 
> In C++ I call the static method twith the following code snippet: 
> 
> QtAndroid::runOnAndroidThread([&]{
>    QAndroidJniObject::callStaticMethod<void>("com/example/example/JavaNatives", "hideCursorHandle");
> });
> 
> In the Android log I can see the "hide" log message, but unfortunately the cursor handle doesn't disappear. 
> 
> Anyone an idea what I am doing wrong here?

---
Юрий Лунёв

skype: darth_bitterman
тел: +7 (908) 51-10-138

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/android-development/attachments/20170209/e5f26862/attachment.html>


More information about the Android-development mailing list