1package android.support.v4.app; 2 3import android.content.Context; 4import android.os.Bundle; 5import android.support.annotation.IdRes; 6import android.support.annotation.Nullable; 7import android.view.View; 8 9 10/** 11 * Callbacks to a {@link Fragment}'s container. 12 */ 13public abstract class FragmentContainer { 14 /** 15 * Return the view with the given resource ID. May return {@code null} if the 16 * view is not a child of this container. 17 */ 18 @Nullable 19 public abstract View onFindViewById(@IdRes int id); 20 21 /** 22 * Return {@code true} if the container holds any view. 23 */ 24 public abstract boolean onHasView(); 25 26 27 /** 28 * Creates an instance of the specified fragment, can be overridden to construct fragments 29 * with dependencies, or change the fragment being constructed. By default just calls 30 * {@link Fragment#instantiate(Context, String, Bundle)}. 31 */ 32 public Fragment instantiate(Context context, String className, Bundle arguments) { 33 return Fragment.instantiate(context, className, arguments); 34 } 35} 36