From 824db6f0f72ef1b4f479ba94968107df333de8db Mon Sep 17 00:00:00 2001 From: Sean Barbeau Date: Wed, 11 Aug 2021 15:21:00 -0400 Subject: [PATCH] fix: Correctly use savedInstanceState in checkbox dialog --- .../com/android/gpstest/GpsStatusFragment.java | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/GPSTest/src/main/java/com/android/gpstest/GpsStatusFragment.java b/GPSTest/src/main/java/com/android/gpstest/GpsStatusFragment.java index 079542aaa..e7ca9a6de 100644 --- a/GPSTest/src/main/java/com/android/gpstest/GpsStatusFragment.java +++ b/GPSTest/src/main/java/com/android/gpstest/GpsStatusFragment.java @@ -17,6 +17,13 @@ package com.android.gpstest; +import static android.util.TypedValue.COMPLEX_UNIT_DIP; +import static android.util.TypedValue.COMPLEX_UNIT_PX; +import static com.android.gpstest.model.ConstellationType.GNSS; +import static com.android.gpstest.model.ConstellationType.SBAS; +import static com.android.gpstest.model.SatelliteStatus.NO_DATA; +import static com.android.gpstest.util.CarrierFreqUtils.CF_UNKNOWN; + import android.annotation.SuppressLint; import android.app.Dialog; import android.content.Context; @@ -84,13 +91,6 @@ import java.util.List; import java.util.Set; -import static android.util.TypedValue.COMPLEX_UNIT_DIP; -import static android.util.TypedValue.COMPLEX_UNIT_PX; -import static com.android.gpstest.model.ConstellationType.GNSS; -import static com.android.gpstest.model.ConstellationType.SBAS; -import static com.android.gpstest.model.SatelliteStatus.NO_DATA; -import static com.android.gpstest.util.CarrierFreqUtils.CF_UNKNOWN; - public class GpsStatusFragment extends Fragment implements GpsTestListener { public final static String TAG = "GpsStatusFragment"; @@ -950,10 +950,9 @@ public Dialog onCreateDialog(Bundle savedInstanceState) { String[] items = args.getStringArray(ITEMS); mChecks = args.getBooleanArray(CHECKS); if (savedInstanceState != null) { - mChecks = args.getBooleanArray(CHECKS); + mChecks = savedInstanceState.getBooleanArray(CHECKS); } - AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); return builder.setTitle(R.string.filter_dialog_title) .setMultiChoiceItems(items, mChecks, this)