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

Ben Lau xbenlau at gmail.com
Sun Nov 23 05:57:28 CET 2014


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/688a0b0a/attachment.html>


More information about the Interest mailing list