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.wujilin.doorbell.starter.FragmentStarter.java

@Override
public Activity getActivity(Fragment starter) {
    return starter.getActivity();
}

From source file:com.albedinsky.android.support.universi.UniversiFragmentDelegate.java

/**
 * Creates a new instance of UniversiFragmentDelegate for the given fragment <var>context</var>.
 *
 * @see UniversiContextDelegate#UniversiContextDelegate(Context)
 *//*w  w  w  .j a  va 2 s .c  om*/
UniversiFragmentDelegate(@NonNull Fragment context) {
    super(context.getActivity());
    this.fragment = context;
}

From source file:org.alfresco.mobile.android.application.managers.ActionUtils.java

public static void actionSendDocuments(Fragment fr, List<File> files) {
    if (files.size() == 1) {
        actionSendDocument(fr, files.get(0));
        return;//from  www  .j  a v  a  2 s . c  o m
    }

    try {
        Intent i = new Intent(Intent.ACTION_SEND_MULTIPLE);
        ArrayList<Uri> uris = new ArrayList<>();
        // convert from paths to Android friendly Parcelable Uri's
        for (File file : files) {
            Uri u = Uri.fromFile(file);
            uris.add(u);
        }
        i.putParcelableArrayListExtra(Intent.EXTRA_STREAM, uris);
        i.setType(MimeTypeManager.getInstance(fr.getActivity()).getMIMEType("text/plain"));
        fr.getActivity()
                .startActivity(Intent.createChooser(i, fr.getActivity().getText(R.string.share_content)));
    } catch (ActivityNotFoundException e) {
        AlfrescoNotificationManager.getInstance(fr.getActivity()).showAlertCrouton(fr.getActivity(),
                R.string.error_unable_share_content);
    }
}

From source file:com.androidformenhancer.helper.SupportFragmentFormHelper.java

/**
 * Constructor. You must specify the Form class representing widget details
 * and validation specifications./*from ww  w.j  av  a 2  s  .  co  m*/
 *
 * @param clazz    class of the form
 * @param fragment fragment which create this object
 */
public SupportFragmentFormHelper(final Class<?> clazz, final Fragment fragment) {
    super(clazz, fragment.getActivity().getBaseContext());
    mFragment = fragment;
    setRootView(fragment.getView().getRootView());
    init();
}

From source file:ru.yandex.subtitles.ui.adapter.ZoomedMessagesAdapter.java

public ZoomedMessagesAdapter(@NonNull final Fragment targetFragment,
        @NonNull final FragmentManager fragmentManager) {
    super(targetFragment.getActivity(), fragmentManager);
    mTargetFragment = targetFragment;//from  w  w w.ja va  2 s .c o m
}

From source file:org.onebusaway.android.util.UIUtils.java

public static void showProgress(Fragment fragment, boolean visible) {
    AppCompatActivity act = (AppCompatActivity) fragment.getActivity();
    if (act != null) {
        act.setSupportProgressBarIndeterminateVisibility(visible);
    }//from   w w w. ja v a 2  s. c om
}

From source file:com.normalexception.app.rx8club.view.pm.PMViewArrayAdapter.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 PMViewArrayAdapter(Fragment context, int textViewResourceId, List<PMModel> objects) {
    super(context.getActivity(), textViewResourceId, objects);
    data = objects;
}

From source file:info.rynkowski.hamsterclient.ui.view.Navigator.java

/**
 * Goes to a {@link FactFormActivity} to allow entering a new fact.
 *
 * @param fragment A {@link Fragment} that opens the {@link FactFormActivity}.
 *//*from  ww w .java 2 s. c  o m*/
public void navigateToFactAdditionForm(@NonNull Fragment fragment) {
    Intent intentToLaunch = FactFormActivity.getCallingIntent(fragment.getActivity());
    fragment.startActivityForResult(intentToLaunch, FactFormActivity.REQUEST_CODE_ADD_FACT);
}

From source file:org.alfresco.mobile.android.application.fragments.site.request.JoinSiteRequestAdapter.java

public JoinSiteRequestAdapter(Fragment fr, int textViewResourceId, List<Site> objects) {
    super(fr.getActivity(), textViewResourceId, objects);
    this.vhClassName = JoinSiteViewHolder.class.getCanonicalName();
    this.fragment = new WeakReference<Fragment>(fr);
}

From source file:com.xbm.android.matisse.Matisse.java

private Matisse(Fragment fragment) {
    this(fragment.getActivity(), fragment);
}