Search in sources :

Example 36 with FragmentActivity

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;
}
Also used : FragmentActivity(android.support.v4.app.FragmentActivity)

Example 37 with FragmentActivity

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;
}
Also used : FragmentManager(android.support.v4.app.FragmentManager)

Example 38 with FragmentActivity

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;
}
Also used : FragmentActivity(android.support.v4.app.FragmentActivity)

Example 39 with FragmentActivity

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;
}
Also used : FragmentActivity(android.support.v4.app.FragmentActivity)

Example 40 with FragmentActivity

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;
}
Also used : FragmentActivity(android.support.v4.app.FragmentActivity) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService)

Aggregations

FragmentActivity (android.support.v4.app.FragmentActivity)84 FragmentTransaction (android.app.FragmentTransaction)16 FragmentManager (android.support.v4.app.FragmentManager)16 FragmentTransaction (android.support.v4.app.FragmentTransaction)16 Fragment (android.support.v4.app.Fragment)11 Intent (android.content.Intent)6 Bundle (android.os.Bundle)5 View (android.view.View)4 DialogFragment (android.support.v4.app.DialogFragment)3 MediaControllerCompat (android.support.v4.media.session.MediaControllerCompat)3 SearchView (android.widget.SearchView)3 TextView (android.widget.TextView)3 Fragment (android.app.Fragment)2 ActionBar (android.support.v7.app.ActionBar)2 AppCompatActivity (android.support.v7.app.AppCompatActivity)2 MediaRouteDialogFactory (android.support.v7.app.MediaRouteDialogFactory)2 RecyclerView (android.support.v7.widget.RecyclerView)2 InjectView (butterknife.InjectView)2 RequestManager (com.bumptech.glide.RequestManager)2 FacebookException (com.facebook.FacebookException)2