diff options
author | Santos Cordon <santoscordon@google.com> | 2013-09-09 20:10:49 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-09-09 20:10:50 +0000 |
commit | 3e6e27d27d79fa027f39c46ea6333b876220bfc7 (patch) | |
tree | 363362b96bca4bd722736bc7b85cd5e58c914bab /InCallUI/src/com/android/incallui/InCallActivity.java | |
parent | be5efd449050985927dcb4c103792228eb930b93 (diff) | |
parent | 1f63d2d8e8db3616c16886952813b3d0473216e7 (diff) |
Merge "Improve lifecycle ordering for InCallUI" into klp-dev
Diffstat (limited to 'InCallUI/src/com/android/incallui/InCallActivity.java')
-rw-r--r-- | InCallUI/src/com/android/incallui/InCallActivity.java | 37 |
1 files changed, 5 insertions, 32 deletions
diff --git a/InCallUI/src/com/android/incallui/InCallActivity.java b/InCallUI/src/com/android/incallui/InCallActivity.java index 4c1d04089..38e2a48b6 100644 --- a/InCallUI/src/com/android/incallui/InCallActivity.java +++ b/InCallUI/src/com/android/incallui/InCallActivity.java @@ -58,14 +58,17 @@ public class InCallActivity extends Activity { // Inflate everything in incall_screen.xml and add it to the screen. setContentView(R.layout.incall_screen); + initializeInCall(); Log.d(this, "onCreate(): exit"); } @Override protected void onStart() { + Log.d(this, "onStart()..."); super.onStart(); - initializeInCall(); + // setting activity should be last thing in setup process + InCallPresenter.getInstance().setActivity(this); } @Override @@ -98,7 +101,7 @@ public class InCallActivity extends Activity { protected void onDestroy() { Log.d(this, "onDestroy()... this = " + this); - tearDownPresenters(); + InCallPresenter.getInstance().setActivity(null); super.onDestroy(); } @@ -293,36 +296,6 @@ public class InCallActivity extends Activity { .findFragmentById(R.id.conferenceManagerFragment); mConferenceManagerFragment.getView().setVisibility(View.INVISIBLE); } - setUpPresenterCallbacks(); - } - - private void setUpPresenterCallbacks() { - InCallPresenter mainPresenter = InCallPresenter.getInstance(); - - mCallButtonFragment.getPresenter().setAudioModeProvider( - mainPresenter.getAudioModeProvider()); - mCallButtonFragment.getPresenter().setProximitySensor( - mainPresenter.getProximitySensor()); - final CallCardPresenter presenter = mCallCardFragment.getPresenter(); - presenter.setAudioModeProvider(mainPresenter.getAudioModeProvider()); - - mainPresenter.addListener(mCallButtonFragment.getPresenter()); - mainPresenter.addListener(mCallCardFragment.getPresenter()); - mainPresenter.addListener(mConferenceManagerFragment.getPresenter()); - - // setting activity should be last thing in setup process - mainPresenter.setActivity(this); - } - - private void tearDownPresenters() { - Log.d(this, "Tearing down presenters."); - InCallPresenter mainPresenter = InCallPresenter.getInstance(); - - mainPresenter.removeListener(mCallButtonFragment.getPresenter()); - mainPresenter.removeListener(mCallCardFragment.getPresenter()); - mainPresenter.removeListener(mConferenceManagerFragment.getPresenter()); - - mainPresenter.setActivity(null); } private void toast(String text) { |