From f50c0e1905f699e929d5f4962d700214aff4c684 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Sun, 21 Sep 2014 22:56:16 +0200 Subject: Fix LogDisplayFragment --- .../keychain/service/results/ConsolidateResult.java | 9 ++++++--- .../keychain/service/results/SingletonResult.java | 4 ++++ .../sufficientlysecure/keychain/ui/LogDisplayFragment.java | 14 ++++---------- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/ConsolidateResult.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/ConsolidateResult.java index c8a469545..2c6a96476 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/ConsolidateResult.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/ConsolidateResult.java @@ -26,13 +26,16 @@ public class ConsolidateResult extends OperationResult { super(result, log); } - /** - * Construct from a parcel - trivial because we have no extra data. - */ + /** Construct from a parcel - trivial because we have no extra data. */ public ConsolidateResult(Parcel source) { super(source); } + @Override + public void writeToParcel(Parcel dest, int flags) { + super.writeToParcel(dest, flags); + } + public static Creator CREATOR = new Creator() { public ConsolidateResult createFromParcel(final Parcel source) { return new ConsolidateResult(source); diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/SingletonResult.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/SingletonResult.java index 374bd6253..642e81246 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/SingletonResult.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/SingletonResult.java @@ -67,7 +67,11 @@ public class SingletonResult extends OperationResult { toast.setIndeterminate(false); toast.setSwipeToDismiss(true); return toast; + } + @Override + public void writeToParcel(Parcel dest, int flags) { + super.writeToParcel(dest, flags); } public static Creator CREATOR = new Creator() { diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/LogDisplayFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/LogDisplayFragment.java index f363520e8..4fdfd3a21 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/LogDisplayFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/LogDisplayFragment.java @@ -57,11 +57,11 @@ public class LogDisplayFragment extends ListFragment implements OnTouchListener public static final String EXTRA_RESULT = "log"; @Override - public void onCreate(Bundle savedInstanceState) { + public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); Intent intent = getActivity().getIntent(); - if (intent.getExtras() == null || !intent.getExtras().containsKey(EXTRA_RESULT)) { + if (intent == null) { getActivity().finish(); return; } @@ -90,7 +90,8 @@ public class LogDisplayFragment extends ListFragment implements OnTouchListener }); getListView().setFastScrollEnabled(true); - + getListView().setDividerHeight(0); + getListView().setOnTouchListener(this); } public void decreaseLogLevel() { @@ -119,13 +120,6 @@ public class LogDisplayFragment extends ListFragment implements OnTouchListener */ } - @Override - public void onActivityCreated(Bundle savedInstanceState) { - super.onActivityCreated(savedInstanceState); - getListView().setDividerHeight(0); - getListView().setOnTouchListener(this); - } - @Override public boolean onTouch(View v, MotionEvent event) { mDetector.onTouchEvent(event); -- cgit v1.2.3