[Android-development] Forcing native menubar to show

BogDan bog_dan_ro at yahoo.com
Fri Apr 4 07:29:04 CEST 2014


Hi,

  There are two pending patches https://codereview.qt-project.org/#change,72098 and https://codereview.qt-project.org/#change,72099 that does everithing you want, sadly except me, nobody wanted to approve them...


Cheers,
BogDan.


> 
> Coming back on this:
> 
> I have investigated using QtAndroid (5.3.0-beta1) to achieve that and I 
> guess this is the way to go.
> 
> I have tried various things involving QAndroidJniObject, 
> QAndroidJniEnvironment and QtAndroid::androidActivity(), but didn't 
> succeed to get what I want.
> 
> For instance:
> 
>      QAndroidJniObject activity=QtAndroid::androidActivity();
>      bool 
> b=QAndroidJniObject::isClassAvailable("android/app/Activity");
>      qWarning()<<"class available?"<<b;
>      //QAndroidJniObject activity("android/app/Activity");
>      if(activity.isValid())
>      {
>          qWarning()<<"activity is valid";
>         
> activity.callMethod<void>("openOptionsMenu","()V");
>      }
> 
> I guess my approach is too simplistic but I couldn't google any good 
> example to do this..
> 
> Any help or hint would be really appreciated
> 
> Thanks
> Philippe LELONG
> 
> Le 01-04-2014 15:27, maitai at virtual-winds.org a écrit :
>>  Hello,
>> 
>>  I have a QMenubar which became "native" on android, all is good. 
> I 
>>  would
>>  like to know if it's possible somehow to trigger it programatically?
>> 
>>  I have tried various menuBar->show() or submenu->exec()... apparently 
> 
>>  no
>>  way.
>> 
>>  The reason I am trying to do that is that I want to show a 
> "native"
>>  contextual menu on tap-and-hold, the current QMenu that I can popup 
>>  does
>>  not look "android" enough to me...
>> 
>>  Thanks
>>  Philippe LELONG
>>  _______________________________________________
>>  Android-development mailing list
>>  Android-development at qt-project.org
>>  http://lists.qt-project.org/mailman/listinfo/android-development
> 
> _______________________________________________
> Android-development mailing list
> Android-development at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/android-development
> 



More information about the Android-development mailing list