From bd5a5c013881c57d29d67a9d6de1618f45dbcb99 Mon Sep 17 00:00:00 2001 From: Vincent Breitmoser Date: Wed, 3 Jun 2015 01:16:06 +0200 Subject: [PATCH] Partially revert "switch to native DialogFragment, fix some nullpointers", but keep nullpointer fixes This reverts commit 403f74f55830dcc5eaa027ccebb888a1122992d1. Conflicts: OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/ProgressDialogFragment.java --- .../keychain/service/ServiceProgressHandler.java | 6 ++++-- .../keychain/ui/dialog/ProgressDialogFragment.java | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/ServiceProgressHandler.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/ServiceProgressHandler.java index 5625408f8..a0bb250d4 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/ServiceProgressHandler.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/ServiceProgressHandler.java @@ -18,14 +18,16 @@ package org.sufficientlysecure.keychain.service; import android.app.Activity; -import android.app.FragmentManager; +import android.content.Intent; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.support.v4.app.FragmentActivity; +import android.support.v4.app.FragmentManager; import org.sufficientlysecure.keychain.Constants; import org.sufficientlysecure.keychain.R; +import org.sufficientlysecure.keychain.operations.results.CertifyResult; import org.sufficientlysecure.keychain.ui.dialog.ProgressDialogFragment; import org.sufficientlysecure.keychain.ui.util.Notify; import org.sufficientlysecure.keychain.util.Log; @@ -97,7 +99,7 @@ public class ServiceProgressHandler extends Handler { // TODO: This is a hack!, see // http://stackoverflow.com/questions/10114324/show-dialogfragment-from-onactivityresult - final FragmentManager manager = activity.getFragmentManager(); + final FragmentManager manager = activity.getSupportFragmentManager(); Handler handler = new Handler(); handler.post(new Runnable() { public void run() { diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/ProgressDialogFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/ProgressDialogFragment.java index 130d22b37..52a90b323 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/ProgressDialogFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/ProgressDialogFragment.java @@ -19,7 +19,6 @@ package org.sufficientlysecure.keychain.ui.dialog; import android.app.Activity; import android.app.Dialog; -import android.app.DialogFragment; import android.app.ProgressDialog; import android.content.DialogInterface; import android.content.DialogInterface.OnKeyListener; @@ -27,6 +26,7 @@ import android.content.Intent; import android.graphics.Color; import android.os.Bundle; import android.support.annotation.NonNull; +import android.support.v4.app.DialogFragment; import android.view.ContextThemeWrapper; import android.view.KeyEvent; import android.view.View; @@ -52,6 +52,7 @@ public class ProgressDialogFragment extends DialogFragment { * @param message the message to be displayed initially above the progress bar * @param style the progress bar style, as defined in ProgressDialog (horizontal or spinner) * @param cancelable should we let the user cancel this operation + * @return */ public static ProgressDialogFragment newInstance(String message, int style, boolean cancelable) { ProgressDialogFragment frag = new ProgressDialogFragment();