Example usage for android.support.v4.app Fragment getActivity

List of usage examples for android.support.v4.app Fragment getActivity

Introduction

In this page you can find the example usage for android.support.v4.app Fragment getActivity.

Prototype

public Activity getActivity() 

Source Link

Usage

From source file:com.florianmski.tracktoid.trakt.tasks.TraktTask.java

public void reconnect(Fragment fragment) {
    this.fragment = fragment;
    this.context = fragment.getActivity();
    tListener = (TraktListener) fragment;
}

From source file:org.alfresco.mobile.android.ui.person.PeopleAdapter.java

public PeopleAdapter(Fragment fr, int textViewResourceId, List<Person> listItems,
        Map<String, Person> selectedItems) {
    super(fr.getActivity(), textViewResourceId, listItems);
    this.selectedItems = selectedItems;
    this.activityRef = new WeakReference<FragmentActivity>(fr.getActivity());
    this.vhClassName = TwoLinesViewHolder.class.getCanonicalName();
}

From source file:org.alfresco.mobile.android.application.fragments.config.ViewConfigTypeItemAdapter.java

public ViewConfigTypeItemAdapter(Fragment fragment, int textViewResourceId, List<ViewConfigModel> objects) {
    super(fragment.getActivity(), textViewResourceId, objects);
    this.vhClassName = TwoLinesViewHolder.class.getCanonicalName();
    fullList = objects;/*from  w  w w  .  j  a  va2  s  . c o  m*/
    mOriginalValues = new ArrayList<>(objects);

}

From source file:org.alfresco.mobile.android.application.ui.form.adapter.NodeFieldAdapter.java

public NodeFieldAdapter(Fragment fr, int textViewResourceId, List<Node> listItems, String propertyId) {
    super(fr.getActivity(), textViewResourceId, listItems);
    this.vhClassName = TwoLinesProgressViewHolder.class.getCanonicalName();
    this.fragmentRef = new WeakReference<Fragment>(fr);
    this.outputValue = propertyId;
}

From source file:prism.framework.DependencyInjector.java

/**
 * Run Dagger injections for a Support Fragment.
 *
 * Runs Dagger's application object graph on the class as well as static
 * injections.//from  ww  w .j av  a2s . co  m
 *
 * @param target The fragment to inject services into
 */
public void inject(android.support.v4.app.Fragment target) {
    Activity parentActivity = target.getActivity();
    this.inject(target, parentActivity);
}

From source file:com.burhan.udacity.popularmovies.ui.adapter.MoviesAdapter.java

public MoviesAdapter(@NonNull Fragment fragment, List<Movie> movies) {
    super(fragment.getActivity(), movies == null ? new ArrayList<>() : movies);
    mFragment = fragment;//from www . ja  v a 2s .com
    setHasStableIds(true);
}

From source file:com.albedinsky.android.support.intent.PlayIntent.java

/**
 * Creates a new instance of PlayIntent for the given <var>fragment</var> context.
 * See {@link com.albedinsky.android.support.intent.BaseIntent#BaseIntent(android.support.v4.app.Fragment)}
 * for additional info./*from  w  w w. ja  v  a  2  s . c  o m*/
 */
public PlayIntent(@NonNull Fragment fragment) {
    super(fragment);
    this.mPackageName = fragment.getActivity().getPackageName();
}

From source file:org.nuxeo.android.layout.LayoutDefinition.java

public NuxeoLayout buildLayout(Fragment fragment, Document doc, ViewGroup parent, LayoutMode mode) {
    ViewGroup container = createTopLayoutContainer(fragment.getActivity(), parent);
    LayoutContext context = new LayoutContext(fragment.getActivity(), container, fragment);
    NuxeoLayout layout = new NuxeoLayout(context, doc);
    try {//from ww  w.  j  a  v a  2 s  . c  om
        for (LayoutRow row : rows) {
            layout.addWidgets(row.buildRow(context, doc, container, widgetDefs, mode));
        }
    } catch (Throwable t) {
        Log.e(this.getClass().getSimpleName(), "Error during Layout definition parsing", t);
    }
    return layout;
}

From source file:com.normalexception.app.rx8club.view.pmitem.PMItemViewArrayAdapter.java

/**
 * Custom adapter to handle PMItemView's
 * @param context            The source context
 * @param textViewResourceId   The resource id
 * @param objects            The list of objects
 *//*from w w w  .  j  a  v  a 2s .c o m*/
public PMItemViewArrayAdapter(Fragment context, int textViewResourceId, List<PMItemModel> objects,
        OnClickListener ocl) {
    super(context.getActivity(), textViewResourceId, objects);
    data = objects;
    _ocl = ocl;
}

From source file:org.ambient.control.home.roomitems.LightObjectStrategy.java

@Override
public View onCreateView(Fragment context, Entity entity) {

    LayoutInflater inflater = (LayoutInflater) context.getActivity()
            .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    RelativeLayout container = (RelativeLayout) inflater.inflate(R.layout.layout_room_item_lightobject_content,
            null);/*www.  j a  v  a2s  .  c o  m*/
    ImageView itemContent = (ImageView) container.findViewById(R.id.imageViewItemIcon);
    updateIcon(((Switchable) entity).getPowerState(), itemContent);

    return container;
}