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.qiscus.sdk.filepicker.FilePickerBuilder.java

private void start(Fragment fragment, int pickerType) {
    Intent intent = new Intent(fragment.getActivity(), FilePickerActivity.class);
    intent.putExtras(pickerOptionsBundle);
    fragment.startActivityForResult(intent,
            pickerType == FilePickerConst.MEDIA_PICKER ? FilePickerConst.REQUEST_CODE_PHOTO
                    : FilePickerConst.REQUEST_CODE_DOC);
}

From source file:com.normalexception.app.rx8club.view.profile.ProfileViewArrayAdapter.java

/**
 * A custom adapter that handles PM View objects
 * @param context            The source context
 * @param textViewResourceId   The resource ID
 * @param objects            The objects in the list
 *//*from  w  w w  . j a v  a2 s.c om*/
public ProfileViewArrayAdapter(Fragment context, int textViewResourceId, List<ProfileModel> objects) {
    super(context.getActivity(), textViewResourceId, objects);
    sourceFragment = context;
    data = objects;
}

From source file:it.sasabz.android.sasabus.classes.dialogs.ConnectionDialog.java

public ConnectionDialog(Fragment fragment, Vector<XMLConnection> list) {
    super(fragment.getActivity());
    this.list = list;
    this.fragment = fragment;
}

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

public MultiValuedStringAdapter(Fragment fr, int textViewResourceId, List<String> listItems,
        boolean isEditable) {
    super(fr.getActivity(), textViewResourceId, listItems);
    this.fragmentRef = new WeakReference<Fragment>(fr);
    this.vhClassName = TwoLinesViewHolder.class.getCanonicalName();
    this.isEditable = isEditable;
}

From source file:com.hunter.fastandroid.adapter.autosrcollviewpager.ImagePagerBaseAdapter2.java

public ImagePagerBaseAdapter2(Fragment fragment, List<String> imageIdList) {
    this.fragment = fragment;
    this.context = fragment.getActivity();
    this.imageIdList = imageIdList;
    //        this.size = ListUtils.getSize(imageIdList);
    this.size = imageIdList.size();
    isInfiniteLoop = false;/*from w  ww .ja  v a 2  s .c o  m*/
}

From source file:com.nick.scalpel.core.AutoBindWirer.java

@Override
public void wire(Fragment fragment, Field field) {
    wire(fragment.getActivity(), fragment, field);
}

From source file:com.albedinsky.android.ui.transition.NavigationalTransitionCompat.java

/**
 * Starts this navigational transition using the given <var>caller</var> fragment with all
 * transitions specified for this navigational transition.
 * <p>//w  w  w. ja  va 2 s. c o m
 * <b>Note</b>, that unlike {@link ##start(Activity)} this cannot be used to start new activity
 * with shared elements presented. For that purpose use {@link #start(Activity)} instead.
 *
 * @param caller The fragment that will be used to create and start an Intent created via
 *               {@link #createIntent(Activity)}.
 * @see #configureTransitionsOverlapping(Activity)
 * @see #configureTransitions(Activity)
 */
public void start(@NonNull Fragment caller) {
    final Activity activity = caller.getActivity();
    configureTransitionsOverlapping(activity);
    configureTransitions(activity);
    onStart(caller);
}

From source file:com.normalexception.app.rx8club.view.threadpost.PostViewArrayAdapter.java

/**
 * Custom adapter to handle PostView's/*  w  ww.j a  v  a2  s. c  o  m*/
 * @param context            The source context
 * @param textViewResourceId   The resource id
 * @param objects            The list of objects
 */
public PostViewArrayAdapter(Fragment context, int textViewResourceId, List<PostModel> objects,
        OnClickListener listener) {
    super(context.getActivity(), textViewResourceId, objects);
    this.data = objects;
    this.listener = listener;
}

From source file:org.microg.tools.selfcheck.SystemChecks.java

@Override
public void tryResolve(Fragment fragment) {
    Intent intent = new Intent(Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS);
    intent.setData(Uri.parse("package:" + fragment.getActivity().getPackageName()));
    fragment.startActivityForResult(intent, REQUEST_IGNORE_BATTERY_OPTIMIZATIONS);
}

From source file:com.albedinsky.android.ui.transition.NavigationalTransitionCompat.java

/**
 * Invoked whenever {@link #start(Fragment)} is called.
 * <p>/*ww  w.  j a va 2s .c  o m*/
 * Default implementation starts an Intent created via {@link #createIntent(Activity)} using
 * the given caller fragment via {@link Fragment#startActivity(Intent)} if there was no
 * {@link #requestCode()} specified and via {@link Fragment#startActivityForResult(Intent, int)}
 * if there was.
 *
 * @param caller The caller fragment that requested start of this navigational transition.
 * @see #onFinish(Fragment)
 */
protected void onStart(@NonNull Fragment caller) {
    final Activity activity = caller.getActivity();
    final Intent intent = createIntent(activity);
    if (intent != null) {
        if (mRequestCode == RC_NONE)
            caller.startActivity(intent);
        else
            caller.startActivityForResult(intent, mRequestCode);
    }
}