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

Liang Jian jianliang79 at gmail.com
Sun Nov 23 05:16:51 CET 2014


    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.


---------- Forwarded message ----------
From: Alejandro Exojo <suy at badopi.org>
Date: Sun, Nov 23, 2014 at 2:59 AM
Subject: Re: [Interest] [qt-android] How can I customize
onResume()/onPause() method of main activity
To: Liang Jian <jianliang79 at gmail.com>


El Saturday 22 November 2014, escribió:
>     I don't want to call method of Activity, but want to execute some
codes
> in QtActivity.onResume()/QtActivity.onPause(). In a word, I want to
> override these methods.

FYI, you replyed privately instead of to the list. Maybe some people skip
the
message because thy think my answer is enough.

I just want to add that I can't reproduce your setup, but I think there has
to
be a way. From this post:

http://blog.qt.digia.com/blog/2013/07/23/anatomy-of-a-qt-5-for-android-
application/

I *think* there has to be a way to add, override or decorate onResume or
onPause.

--
Alex (a.k.a. suy) | GPG ID 0x0B8B0BC2
http://barnacity.net/ | http://disperso.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20141123/e4e68287/attachment.html>


More information about the Interest mailing list