use of android.support.v4.app.FragmentActivity in project Douya by DreaminginCodeZH.
the class UserReviewListResource method attachTo.
public static UserReviewListResource attachTo(String userIdOrUid, Fragment fragment, String tag, int requestCode) {
FragmentActivity activity = fragment.getActivity();
UserReviewListResource instance = FragmentUtils.findByTag(activity, tag);
if (instance == null) {
instance = newInstance(userIdOrUid);
instance.targetAt(fragment, requestCode);
FragmentUtils.add(instance, activity, tag);
}
return instance;
}
use of android.support.v4.app.FragmentActivity in project Douya by DreaminginCodeZH.
the class ScalpelHelperFragment method attachTo.
/**
* @deprecated Use {@link #attachTo(Fragment)} instead.
*/
public static ScalpelHelperFragment attachTo(FragmentActivity activity) {
FragmentManager fragmentManager = activity.getSupportFragmentManager();
ScalpelHelperFragment fragment = (ScalpelHelperFragment) fragmentManager.findFragmentByTag(FRAGMENT_TAG);
if (fragment == null) {
fragment = new ScalpelHelperFragment();
fragmentManager.beginTransaction().add(fragment, FRAGMENT_TAG).commit();
}
return fragment;
}
use of android.support.v4.app.FragmentActivity in project Douya by DreaminginCodeZH.
the class UserResource method attachTo.
public static UserResource attachTo(String userIdOrUid, SimpleUser simpleUser, User user, Fragment fragment, String tag, int requestCode) {
FragmentActivity activity = fragment.getActivity();
UserResource instance = FragmentUtils.findByTag(activity, tag);
if (instance == null) {
instance = newInstance(userIdOrUid, simpleUser, user);
instance.targetAt(fragment, requestCode);
FragmentUtils.add(instance, activity, tag);
}
return instance;
}
use of android.support.v4.app.FragmentActivity in project Douya by DreaminginCodeZH.
the class NotificationListResource method attachTo.
public static NotificationListResource attachTo(Fragment fragment, String tag, int requestCode) {
FragmentActivity activity = fragment.getActivity();
NotificationListResource instance = FragmentUtils.findByTag(activity, tag);
if (instance == null) {
instance = newInstance();
instance.targetAt(fragment, requestCode);
FragmentUtils.add(instance, activity, tag);
}
return instance;
}
use of android.support.v4.app.FragmentActivity in project Gadgetbridge by Freeyourgadget.
the class LiveActivityFragment method startActivityPulse.
private ScheduledExecutorService startActivityPulse() {
ScheduledExecutorService service = Executors.newSingleThreadScheduledExecutor();
service.scheduleAtFixedRate(new Runnable() {
@Override
public void run() {
FragmentActivity activity = LiveActivityFragment.this.getActivity();
if (activity != null && !activity.isFinishing() && !activity.isDestroyed()) {
activity.runOnUiThread(new Runnable() {
@Override
public void run() {
pulse();
}
});
}
}
}, 0, getPulseIntervalMillis(), TimeUnit.MILLISECONDS);
return service;
}
Aggregations