2017-02-07 02:01:32 +08:00
|
|
|
package com.topjohnwu.magisk.components;
|
|
|
|
|
|
|
|
import com.topjohnwu.magisk.MagiskManager;
|
2017-08-04 00:12:11 +08:00
|
|
|
import com.topjohnwu.magisk.utils.Topic;
|
2017-02-12 05:02:18 +08:00
|
|
|
import com.topjohnwu.magisk.utils.Utils;
|
2017-02-07 02:01:32 +08:00
|
|
|
|
|
|
|
public class Fragment extends android.support.v4.app.Fragment {
|
|
|
|
|
|
|
|
public MagiskManager getApplication() {
|
2017-02-12 05:02:18 +08:00
|
|
|
return Utils.getMagiskManager(getActivity());
|
2017-02-07 02:01:32 +08:00
|
|
|
}
|
|
|
|
|
2017-07-23 00:12:15 +08:00
|
|
|
@Override
|
|
|
|
public void onResume() {
|
|
|
|
super.onResume();
|
2017-08-04 00:12:11 +08:00
|
|
|
if (this instanceof Topic.Subscriber) {
|
|
|
|
((Topic.Subscriber) this).subscribeTopics();
|
2017-07-23 00:12:15 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onPause() {
|
2017-08-04 00:12:11 +08:00
|
|
|
if (this instanceof Topic.Subscriber) {
|
|
|
|
((Topic.Subscriber) this).unsubscribeTopics();
|
2017-07-23 00:12:15 +08:00
|
|
|
}
|
|
|
|
super.onPause();
|
|
|
|
}
|
2017-02-07 02:01:32 +08:00
|
|
|
}
|