Reputation: 2949
I examining the Qt Notifier example for android: https://doc.qt.io/qt-5/qtandroidextras-notification-example.html In this example, a Java method is called with 2 parameters, like this:
void NotificationClient::updateAndroidNotification()
{
QAndroidJniObject javaNotification = QAndroidJniObject::fromString(m_notification);
QAndroidJniObject::callStaticMethod<void>("org/qtproject/example/notification/NotificationClient",
"notify",
"(Ljava/lang/String;)V",
javaNotification.object<jstring>());
}
I am having hard time understanding what parameters I should pass in here to call the function with 2 parameters, not one. For instance, the function currently takes 1 parameter:
public static void notify(String s)
{
if (m_notificationManager == null) {
m_notificationManager =
(NotificationManager)m_instance.getSystemService(Context.NOTIFICATION_SERVICE);
m_builder = new Notification.Builder(m_instance);
m_builder.setSmallIcon(R.drawable.icon);
m_builder.setContentTitle("A message from Qt!");
}
m_builder.setContentText(s);
m_notificationManager.notify(1, m_builder.build());
}
I can add another one in the method itself ( public static void notify(String s, String x)
), but how to handle the cpp part?
Upvotes: 0
Views: 276