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();
}
}
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();
}
}
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();
}
}
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;
}
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;
}
Aggregations