Android: Look at all the conditionals you'll save
This commit is contained in:
parent
632a5eb065
commit
def787b829
|
@ -379,38 +379,16 @@ public class MainActivity extends AppCompatActivity implements
|
|||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
InputFragment fragment = (InputFragment) getSupportFragmentManager()
|
||||
.findFragmentByTag("INPUT_FRAG");
|
||||
if (fragment != null && fragment.isVisible()) {
|
||||
if (fragment.moga != null) {
|
||||
fragment.moga.onPause();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
InputFragment fragment = (InputFragment) getSupportFragmentManager()
|
||||
.findFragmentByTag("INPUT_FRAG");
|
||||
if (fragment != null && fragment.isVisible()) {
|
||||
if (fragment.moga != null) {
|
||||
fragment.moga.onDestroy();
|
||||
}
|
||||
}
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
InputFragment fragment = (InputFragment) getSupportFragmentManager()
|
||||
.findFragmentByTag("INPUT_FRAG");
|
||||
if (fragment != null && fragment.isVisible()) {
|
||||
if (fragment.moga != null) {
|
||||
fragment.moga.onResume();
|
||||
}
|
||||
}
|
||||
|
||||
CloudFragment cloudfragment = (CloudFragment) getSupportFragmentManager()
|
||||
.findFragmentByTag("CLOUD_FRAG");
|
||||
if (cloudfragment != null && cloudfragment.isVisible()) {
|
||||
|
|
Loading…
Reference in New Issue