Skip to content

Commit

Permalink
在颜色选择弹出框选择颜色后点击取消也会改变sum显示的值(真实值)
Browse files Browse the repository at this point in the history
  • Loading branch information
CaptainHuangsh committed May 13, 2017
1 parent 342660b commit a9b9058
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;

import com.example.owenh.alarmo.R;
import com.example.owenh.alarmo.common.C;
Expand Down Expand Up @@ -51,28 +50,24 @@ public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.pref_settings);
mColor = findPreference("take_color");
Toast.makeText(getActivity(), "onCreate", Toast.LENGTH_SHORT).show();
mColor.setOnPreferenceClickListener(this);
initPref();
}

@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
Toast.makeText(getActivity(), "onCreateView", Toast.LENGTH_SHORT).show();
return super.onCreateView(inflater, container, savedInstanceState);
}

@Override
public void onStart() {
super.onStart();
Toast.makeText(getActivity(), "onStart", Toast.LENGTH_SHORT).show();
initPref();
}

@Override
public void onResume() {
super.onResume();
Toast.makeText(getActivity(), "onResume", Toast.LENGTH_SHORT).show();
initPref();
}

Expand Down Expand Up @@ -121,6 +116,7 @@ public void onYesClick() {
dialog.setNoOnclickListener(new ColorDialog.onNoOnclickListener() {
@Override
public void onNoClick() {
initPref();
finalDialog.dismiss();
}
});
Expand Down

0 comments on commit a9b9058

Please sign in to comment.