Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QAndroidIntent Class Reference

\inheaderfile QtCore/private/qandroidextras_p.h \preliminary \inmodule QtCorePrivate More...

#include <qandroidextras_p.h>

+ Collaboration diagram for QAndroidIntent:

Public Member Functions

 QAndroidIntent ()
 Create a new intent.
 
virtual ~QAndroidIntent ()
 
 QAndroidIntent (const QJniObject &intent)
 Wraps the provided intent java object.
 
 QAndroidIntent (const QString &action)
 Creates a new intent and sets the provided action.
 
 QAndroidIntent (const QJniObject &packageContext, const char *className)
 Creates a new intent and sets the provided packageContext and the service className.
 
void putExtra (const QString &key, const QByteArray &data)
 Sets the key with the data in the Intent extras.
 
QByteArray extraBytes (const QString &key)
 Returns the extra key data from the Intent extras.
 
void putExtra (const QString &key, const QVariant &value)
 Sets the key with the value in the Intent extras.
 
QVariant extraVariant (const QString &key)
 Returns the extra key data from the Intent extras as a QVariant.
 
QJniObject handle () const
 The return value is useful to call other Java API which are not covered by this wrapper.
 

Detailed Description

\inheaderfile QtCore/private/qandroidextras_p.h \preliminary \inmodule QtCorePrivate

Wraps the most important methods of Android Intent class.

The QAndroidIntent is a convenience class that wraps the most important \l {https://developer.android.com/reference/android/content/Intent.html}{Android Intent} methods.

qtcoreprivate-usage

Since
6.2

Definition at line 126 of file qandroidextras_p.h.

Constructor & Destructor Documentation

◆ QAndroidIntent() [1/4]

QAndroidIntent::QAndroidIntent ( )

Create a new intent.

Definition at line 734 of file qandroidextras.cpp.

◆ ~QAndroidIntent()

QAndroidIntent::~QAndroidIntent ( )
virtual

Definition at line 740 of file qandroidextras.cpp.

◆ QAndroidIntent() [2/4]

QAndroidIntent::QAndroidIntent ( const QJniObject & intent)
explicit

Wraps the provided intent java object.

Definition at line 746 of file qandroidextras.cpp.

◆ QAndroidIntent() [3/4]

QAndroidIntent::QAndroidIntent ( const QString & action)
explicit

Creates a new intent and sets the provided action.

Definition at line 754 of file qandroidextras.cpp.

◆ QAndroidIntent() [4/4]

QAndroidIntent::QAndroidIntent ( const QJniObject & packageContext,
const char * className )
explicit

Creates a new intent and sets the provided packageContext and the service className.

Example:

auto serviceIntent = QAndroidIntent(QtAndroidPrivate::androidActivity().object(), "com.example.MyService");
QAndroidIntent()
Create a new intent.
See also
QtAndroidPrivate::bindService

Definition at line 770 of file qandroidextras.cpp.

Member Function Documentation

◆ extraBytes()

QByteArray QAndroidIntent::extraBytes ( const QString & key)

Returns the extra key data from the Intent extras.

Definition at line 796 of file qandroidextras.cpp.

References QByteArray(), and Qt::Uninitialized.

Referenced by extraVariant().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ extraVariant()

QVariant QAndroidIntent::extraVariant ( const QString & key)

Returns the extra key data from the Intent extras as a QVariant.

Definition at line 827 of file qandroidextras.cpp.

References extraBytes().

+ Here is the call graph for this function:

◆ handle()

QJniObject QAndroidIntent::handle ( ) const

The return value is useful to call other Java API which are not covered by this wrapper.

Definition at line 838 of file qandroidextras.cpp.

◆ putExtra() [1/2]

void QAndroidIntent::putExtra ( const QString & key,
const QByteArray & data )

Sets the key with the data in the Intent extras.

Definition at line 780 of file qandroidextras.cpp.

Referenced by putExtra().

+ Here is the caller graph for this function:

◆ putExtra() [2/2]

void QAndroidIntent::putExtra ( const QString & key,
const QVariant & value )

Sets the key with the value in the Intent extras.

Definition at line 816 of file qandroidextras.cpp.

References putExtra(), and QIODeviceBase::WriteOnly.

+ Here is the call graph for this function:

The documentation for this class was generated from the following files: