diff options
author | Christine Chen <christinech@google.com> | 2013-10-09 18:31:42 -0700 |
---|---|---|
committer | Christine Chen <christinech@google.com> | 2013-10-10 19:44:55 -0700 |
commit | 7ccd75891257df73d27b423ce168b72336d8a6af (patch) | |
tree | 50da153126e4f1b11ec91c77ebbb4fcd91b0ddcf /InCallUI/src/com/android/incallui/AnswerFragment.java | |
parent | e82d724dfd731d3e1a34908d72eb2e2884d9de47 (diff) |
Removes stopPing from onSaveInstanceState()
- I don't think it makes sense to do any processing in
onSaveInstanceState() as we are already stopping the ping in
onWindowVisibilityChanged.
- onSaveInstanceState() should solely deal with saving app states
anyway.
Bug: 11156202
Change-Id: If2b17bd10b455899703aa2c8f9d15f04a9bea22f
Diffstat (limited to 'InCallUI/src/com/android/incallui/AnswerFragment.java')
-rw-r--r-- | InCallUI/src/com/android/incallui/AnswerFragment.java | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/InCallUI/src/com/android/incallui/AnswerFragment.java b/InCallUI/src/com/android/incallui/AnswerFragment.java index 1b249f29f..a53d8c9e0 100644 --- a/InCallUI/src/com/android/incallui/AnswerFragment.java +++ b/InCallUI/src/com/android/incallui/AnswerFragment.java @@ -79,14 +79,33 @@ public class AnswerFragment extends BaseFragment<AnswerPresenter, AnswerPresente mGlowpad = (GlowPadWrapper) inflater.inflate(R.layout.answer_fragment, container, false); + Log.d(this, "Creating view for answer fragment ", this); + Log.d(this, "Created from activity", getActivity()); mGlowpad.setAnswerListener(this); return mGlowpad; } @Override + public void onDestroyView() { + Log.d(this, "onDestroyView"); + if (mGlowpad != null) { + mGlowpad.stopPing(); + mGlowpad = null; + } + super.onDestroyView(); + } + + @Override public void showAnswerUi(boolean show) { getView().setVisibility(show ? View.VISIBLE : View.GONE); + + Log.d(this, "Show answer UI: " + show); + if (show) { + mGlowpad.startPing(); + } else { + mGlowpad.stopPing(); + } } @Override @@ -126,6 +145,14 @@ public class AnswerFragment extends BaseFragment<AnswerPresenter, AnswerPresente final AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()).setCancelable( true).setView(lv); + builder.setOnCancelListener(new DialogInterface.OnCancelListener() { + @Override + public void onCancel(DialogInterface dialogInterface) { + if (mGlowpad != null) { + mGlowpad.startPing(); + } + } + }); mCannedResponsePopup = builder.create(); mCannedResponsePopup.show(); } |