Skip to content

Commit

Permalink
fix: Correctly use savedInstanceState in checkbox dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
barbeau committed Aug 11, 2021
1 parent 303f797 commit 824db6f
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions GPSTest/src/main/java/com/android/gpstest/GpsStatusFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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";
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 824db6f

Please sign in to comment.