Search in sources :

Example 11 with Loader

use of android.support.v4.content.Loader in project Android-DialogFragments by wada811.

the class LoaderSpinnerProgressDialogFragmentExamplesActivity method onLoaderReset.

@Override
public void onLoaderReset(Loader<Object> loader) {
    Log.i(TAG, "onLoaderReset");
    getSupportLoaderManager().destroyLoader(loader.getId());
    Fragment fragment = getSupportFragmentManager().findFragmentByTag(ProgressDialogFragment.TAG);
    if (fragment != null) {
        ProgressDialogFragment dialogFragment = (ProgressDialogFragment) fragment;
        dialogFragment.dismissAllowingStateLoss();
    }
}
Also used : ProgressDialogFragment(com.wada811.android.dialogfragments.traditional.ProgressDialogFragment) Fragment(android.support.v4.app.Fragment) ProgressDialogFragment(com.wada811.android.dialogfragments.traditional.ProgressDialogFragment)

Example 12 with Loader

use of android.support.v4.content.Loader in project Android-DialogFragments by wada811.

the class LoaderSpinnerProgressDialogFragmentExamplesFragment method onLoaderReset.

@Override
public void onLoaderReset(Loader<Object> objectLoader) {
    Log.i(TAG, "onLoaderReset");
    getLoaderManager().destroyLoader(objectLoader.getId());
    Fragment fragment = getChildFragmentManager().findFragmentByTag(ProgressDialogFragment.TAG);
    if (fragment != null) {
        ProgressDialogFragment dialogFragment = (ProgressDialogFragment) fragment;
        dialogFragment.dismissAllowingStateLoss();
    }
}
Also used : ProgressDialogFragment(com.wada811.android.dialogfragments.traditional.ProgressDialogFragment) Fragment(android.support.v4.app.Fragment) ListFragment(android.support.v4.app.ListFragment) ProgressDialogFragment(com.wada811.android.dialogfragments.traditional.ProgressDialogFragment)

Example 13 with Loader

use of android.support.v4.content.Loader in project Android-DialogFragments by wada811.

the class LoaderSpinnerProgressDialogFragmentExamplesFragment method onLoadFinished.

@Override
public void onLoadFinished(Loader<Object> objectLoader, Object o) {
    Log.i(TAG, "onLoadFinished");
    getLoaderManager().destroyLoader(objectLoader.getId());
    Fragment fragment = getChildFragmentManager().findFragmentByTag(ProgressDialogFragment.TAG);
    if (fragment != null) {
        ProgressDialogFragment dialogFragment = (ProgressDialogFragment) fragment;
        dialogFragment.dismissAllowingStateLoss();
    }
}
Also used : ProgressDialogFragment(com.wada811.android.dialogfragments.traditional.ProgressDialogFragment) Fragment(android.support.v4.app.Fragment) ListFragment(android.support.v4.app.ListFragment) ProgressDialogFragment(com.wada811.android.dialogfragments.traditional.ProgressDialogFragment)

Example 14 with Loader

use of android.support.v4.content.Loader in project WordPress-Android by wordpress-mobile.

the class EditPostActivity method getRealPathFromContentURI.

private String getRealPathFromContentURI(Uri contentUri) {
    if (contentUri == null)
        return null;
    String[] proj = { android.provider.MediaStore.Images.Media.DATA };
    CursorLoader loader = new CursorLoader(this, contentUri, proj, null, null, null);
    Cursor cursor = loader.loadInBackground();
    if (cursor == null)
        return null;
    int column_index = cursor.getColumnIndex(proj[0]);
    if (column_index == -1) {
        cursor.close();
        return null;
    }
    String path;
    if (cursor.moveToFirst()) {
        path = cursor.getString(column_index);
    } else {
        path = null;
    }
    cursor.close();
    return path;
}
Also used : CursorLoader(android.support.v4.content.CursorLoader) Cursor(android.database.Cursor)

Example 15 with Loader

use of android.support.v4.content.Loader in project AgentWeb by Justson.

the class AgentWebUtils method getRealPathBelowVersion.

private static String getRealPathBelowVersion(Context context, Uri uri) {
    String filePath = null;
    String[] projection = { MediaStore.Images.Media.DATA };
    CursorLoader loader = new CursorLoader(context, uri, projection, null, null, null);
    Cursor cursor = loader.loadInBackground();
    if (cursor != null) {
        cursor.moveToFirst();
        filePath = cursor.getString(cursor.getColumnIndex(projection[0]));
        cursor.close();
    }
    return filePath;
}
Also used : CursorLoader(android.support.v4.content.CursorLoader) SpannableString(android.text.SpannableString) Cursor(android.database.Cursor)

Aggregations

Bundle (android.os.Bundle)16 Fragment (android.support.v4.app.Fragment)16 CursorLoader (android.support.v4.content.CursorLoader)11 View (android.view.View)7 Context (android.content.Context)6 Parcelable (android.os.Parcelable)6 RecyclerView (android.support.v7.widget.RecyclerView)6 ImageView (android.widget.ImageView)6 TextView (android.widget.TextView)6 ActivityManager (android.app.ActivityManager)5 Point (android.graphics.Point)5 AccessibilityNodeInfoCompat (android.support.v4.view.accessibility.AccessibilityNodeInfoCompat)5 GridLayoutManager (android.support.v7.widget.GridLayoutManager)5 SpanSizeLookup (android.support.v7.widget.GridLayoutManager.SpanSizeLookup)5 Recycler (android.support.v7.widget.RecyclerView.Recycler)5 ViewHolder (android.support.v7.widget.RecyclerView.ViewHolder)5 DocumentClipper (com.android.documentsui.DocumentClipper)5 State (com.android.documentsui.State)5 Selection (com.android.documentsui.dirlist.MultiSelectManager.Selection)5 Cursor (android.database.Cursor)4