mirror of https://github.com/qt/qtbase.git
Android: Fix deprecations AlertDialog.setButton()
https://developer.android.com/reference/android/app/ AlertDialog#setButton(java.lang.CharSequence, %20android.content.DialogInterface.OnClickListener) Pick-to: 6.5 6.4 6.2 5.15 Change-Id: I470acba581b7226b2d4a56754cf6372baa167eb4 Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
This commit is contained in:
parent
32666691c2
commit
40b42ac517
|
@ -5,6 +5,7 @@
|
|||
package org.qtproject.qt.android.bindings;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.ContextWrapper;
|
||||
import android.content.DialogInterface;
|
||||
|
@ -146,7 +147,8 @@ public abstract class QtLoader {
|
|||
// fatal error, show the error and quit
|
||||
AlertDialog errorDialog = new AlertDialog.Builder(m_context).create();
|
||||
errorDialog.setMessage(loaderParams.getString(ERROR_MESSAGE_KEY));
|
||||
errorDialog.setButton(resources.getString(android.R.string.ok),
|
||||
errorDialog.setButton(Dialog.BUTTON_POSITIVE,
|
||||
resources.getString(android.R.string.ok),
|
||||
new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
|
@ -197,7 +199,8 @@ public abstract class QtLoader {
|
|||
int id = resources.getIdentifier("fatal_error_msg", "string",
|
||||
packageName);
|
||||
errorDialog.setMessage(resources.getString(id));
|
||||
errorDialog.setButton(resources.getString(android.R.string.ok),
|
||||
errorDialog.setButton(Dialog.BUTTON_POSITIVE,
|
||||
resources.getString(android.R.string.ok),
|
||||
new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
|
|
Loading…
Reference in New Issue