use of androidx.fragment.app.Fragment in project J2ME-Loader by nikita36078.
the class DonationsActivity method onActivityResult.
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
FragmentManager fragmentManager = getSupportFragmentManager();
Fragment fragment = fragmentManager.findFragmentByTag("donationsFragment");
if (fragment != null) {
fragment.onActivityResult(requestCode, resultCode, data);
}
}
use of androidx.fragment.app.Fragment in project K6nele by Kaljurand.
the class Preferences method onPreferenceStartFragment.
@Override
public boolean onPreferenceStartFragment(PreferenceFragmentCompat caller, Preference pref) {
// Instantiate the new Fragment
final Bundle args = pref.getExtras();
final Fragment fragment = getSupportFragmentManager().getFragmentFactory().instantiate(getClassLoader(), pref.getFragment());
fragment.setArguments(args);
fragment.setTargetFragment(caller, 0);
// Replace the existing Fragment with the new Fragment
getSupportFragmentManager().beginTransaction().replace(android.R.id.content, fragment).addToBackStack(null).commit();
return true;
}
use of androidx.fragment.app.Fragment in project PocketHub by pockethub.
the class GistFilesPagerAdapter method getItem.
@Override
public Fragment getItem(final int position) {
GistFile file = files[position];
Fragment fragment = new GistFileFragment();
Bundle args = new Bundle();
args.putParcelable(EXTRA_GIST_FILE, file);
fragment.setArguments(args);
return fragment;
}
use of androidx.fragment.app.Fragment in project PocketHub by pockethub.
the class GistsPagerAdapter method getItem.
@Override
public Fragment getItem(int position) {
Fragment fragment = new GistFragment();
Bundle args = new Bundle();
args.putString(EXTRA_GIST_ID, ids[position]);
fragment.setArguments(args);
return fragment;
}
use of androidx.fragment.app.Fragment in project PocketHub by pockethub.
the class FragmentPagerAdapter method clearAdapter.
/**
* This methods clears any fragments that may not apply to the newly
* selected org.
*
* @return this adapter
*/
public FragmentPagerAdapter clearAdapter() {
if (tags.isEmpty()) {
return this;
}
FragmentTransaction transaction = fragmentManager.beginTransaction();
for (String tag : tags) {
Fragment fragment = fragmentManager.findFragmentByTag(tag);
if (fragment != null) {
transaction.remove(fragment);
}
}
transaction.commit();
tags.clear();
return this;
}
Aggregations