[Interest] Fwd: [qt-android] How can I customize onResume()/onPause() method of main activity

Liang Jian jianliang79 at gmail.com
Sun Nov 23 07:02:36 CET 2014


     That is a better approach. Thank you so much!

On Sun, Nov 23, 2014 at 12:57 PM, Ben Lau <xbenlau at gmail.com> wrote:

>
> On 23 November 2014 at 12:16, Liang Jian <jianliang79 at gmail.com> wrote:
>
>>     In fact, I didn't realized that I have used private reply, it is my
>> fault.
>>     Thank you for the reply and now I know that there is at least one way
>> to achieve my goal: just make a copy of
>> $QT/src/android/java/src/org/qtproject/qt5/android/binding/QtActivity.java
>> to my project's own android source folder, modify this file and use
>> ANDROID_PACKAGE_SOURCE_DIR in *.pro to point to my own android source
>> folder, then upon deployment Qt will use the modified version of
>> QtActivity.java. But his method has a drawback: once I have upgraded Qt
>> version, I have to re-generate my own QtActivity.java based on the current
>> version shipped by Qt. But right now this is the only way I found to solve
>> my problem.
>>
>>
>>
> Hi Liang Jian,
>
> You may write your own activity class and inherit the QtActivity , then
> override the methods needed.
>
> e.g
>
> public class YourAppActivity extends org.qtproject.qt5.android.bindings.QtActivity { ... }
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20141123/889c8f91/attachment.html>


More information about the Interest mailing list