本文整理汇总了Java中android.support.v4.app.Fragment.onActivityResult方法的典型用法代码示例。如果您正苦于以下问题:Java Fragment.onActivityResult方法的具体用法?Java Fragment.onActivityResult怎么用?Java Fragment.onActivityResult使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.v4.app.Fragment
的用法示例。
在下文中一共展示了Fragment.onActivityResult方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onActivityResult
import android.support.v4.app.Fragment; //导入方法依赖的package包/类
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == PROFILE_REQUEST && resultCode == CommonStatusCodes.SUCCESS) {
preferences.setIdAuth("");
preferences.setUserData("");
preferences.setUserDni("");
preferences.setEmail("");
preferences.setIsLogged(false);
setDataToHeader(preferences);
if (!(getSupportFragmentManager().findFragmentById(R.id.containerHome) instanceof MapFragment)) {
navigationView.getMenu().getItem(0).setChecked(true);
setTitleToolbar(getString(R.string.map_stations));
getSupportFragmentManager().popBackStack("", FragmentManager.POP_BACK_STACK_INCLUSIVE);
}
} else if (requestCode == 140) {
Fragment fragment = getSupportFragmentManager().findFragmentById(R.id.containerHome);
if (fragment != null && fragment instanceof MapFragment) {
fragment.onActivityResult(requestCode, resultCode, data);
}
} else if (resultCode == Activity.RESULT_OK && requestCode == LoginActivity.LOGIN_RESULT) {
navigationView.getMenu().getItem(itemSelected).setChecked(true);
preferences.setIsLogged(true);
setDataToHeader(preferences);
}
}
示例2: onActivityResult
import android.support.v4.app.Fragment; //导入方法依赖的package包/类
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
switch (requestCode) {
case CreateNoteDialogFragment.REQ_SELECT_IMAGE:
Fragment fragment = getChildFragmentManager().findFragmentByTag(CreateNoteDialogFragment.TAG);
if (fragment != null) {
// somehow the event doesn't get dispatched correctly
fragment.onActivityResult(requestCode, resultCode, data);
} else {
super.onActivityResult(requestCode, resultCode, data);
}
break;
default:
super.onActivityResult(requestCode, resultCode, data);
break;
}
}
示例3: onActivityResult
import android.support.v4.app.Fragment; //导入方法依赖的package包/类
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
switch (requestCode) {
case CreateNoteDialogFragment.REQ_SELECT_IMAGE:
Fragment fragment = getSupportFragmentManager().findFragmentById(R.id.fragment_container);
if (fragment != null) {
// somehow the event doesn't get dispatched correctly
fragment.onActivityResult(requestCode, resultCode, data);
} else {
super.onActivityResult(requestCode, resultCode, data);
}
break;
default:
super.onActivityResult(requestCode, resultCode, data);
break;
}
}
示例4: onActivityResult
import android.support.v4.app.Fragment; //导入方法依赖的package包/类
/**
* Needed for Google Play In-app Billing. It uses startIntentSenderForResult(). The result is not propagated to
* the Fragment like in startActivityForResult(). Thus we need to propagate manually to our Fragment.
*/
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
Button b = ((Button)findViewById(org.sufficientlysecure.donations.R.id.donations__google_android_market_donate_button));
b.setEnabled(true);
FragmentManager fragmentManager = getSupportFragmentManager();
Fragment fragment = fragmentManager.findFragmentByTag("donationsFragment");
if (fragment != null) {
fragment.onActivityResult(requestCode, resultCode, data);
//TODO donation event, set settings?
}
}
示例5: onActivityResult
import android.support.v4.app.Fragment; //导入方法依赖的package包/类
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
Fragment fragment = getSupportFragmentManager().findFragmentByTag(TAG_CREDIT_CARD_FRAGMENT);
if (fragment instanceof CreditCardFragment) {
fragment.onActivityResult(requestCode, resultCode, data);
}
}
示例6: onActivityResult
import android.support.v4.app.Fragment; //导入方法依赖的package包/类
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data)
{
super.onActivityResult(requestCode, resultCode, data);
Fragment fragment = getSupportFragmentManager().findFragmentById(android.R.id.content);
fragment.onActivityResult(requestCode, resultCode, data);
}
示例7: onActivityResult
import android.support.v4.app.Fragment; //导入方法依赖的package包/类
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
Fragment fragment = getSupportFragmentManager().findFragmentById(R.id.preference_fragment);
fragment.onActivityResult(requestCode, resultCode, data);
}
示例8: onActivityResult
import android.support.v4.app.Fragment; //导入方法依赖的package包/类
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
for (Fragment fragment : getSupportFragmentManager().getFragments())
{
if (fragment != null)
{
fragment.onActivityResult(requestCode, resultCode, data);
}
}
}
示例9: processCallback
import android.support.v4.app.Fragment; //导入方法依赖的package包/类
private void processCallback(int resultCode, Bundle bundle) {
Fragment fragment = getTargetFragment();
if (fragment != null) {
if (fragment instanceof BFragment) {
((BFragment) fragment).onFragmentResult(getTargetRequestCode(), resultCode, bundle);
} else {
Intent intent = new Intent();
intent.putExtras(bundle);
fragment.onActivityResult(getTargetRequestCode(), resultCode, intent);
}
}
}
示例10: postResult
import android.support.v4.app.Fragment; //导入方法依赖的package包/类
public void postResult(int resultCode, Bundle bundle){
Fragment fragment = getTargetFragment();
if (fragment != null) {
if (fragment instanceof BFragment) {
((BFragment) fragment).onFragmentResult(getTargetRequestCode(), resultCode, bundle);
} else {
Intent intent = new Intent();
intent.putExtras(bundle);
fragment.onActivityResult(getTargetRequestCode(), resultCode, intent);
}
}
}
示例11: onActivityResult
import android.support.v4.app.Fragment; //导入方法依赖的package包/类
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
List<Fragment> fragments = getSupportFragmentManager().getFragments();
if (fragments != null) {
for (Fragment fragment : fragments) {
if(null != fragment) {
fragment.onActivityResult(requestCode, resultCode, data);
}
}
}
}
示例12: onActivityResult
import android.support.v4.app.Fragment; //导入方法依赖的package包/类
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
List<Fragment> fragments = getChildFragmentManager().getFragments();
if (fragments != null) {
for (Fragment fragment : fragments) {
fragment.onActivityResult(requestCode, resultCode, data);
}
}
}
示例13: onActivityResult
import android.support.v4.app.Fragment; //导入方法依赖的package包/类
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
//noinspection RestrictedApi
List<Fragment> fragments = getChildFragmentManager().getFragments();
if (fragments != null) {
for (Fragment fragment : fragments) {
if(null != fragment) {
fragment.onActivityResult(requestCode, resultCode, data);
}
}
}
}
示例14: onActivityResult
import android.support.v4.app.Fragment; //导入方法依赖的package包/类
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
for (WeakReference<Fragment> fragmentRef : fragments) {
Fragment fragment = fragmentRef.get();
if (fragment != null)
fragment.onActivityResult(requestCode, resultCode, data);
}
}
示例15: onActivityResult
import android.support.v4.app.Fragment; //导入方法依赖的package包/类
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
Fragment fragment = getSupportFragmentManager().findFragmentByTag("android:switcher:" + R.id.tab_layout_pager + ":" + 1);
if(fragment != null) fragment.onActivityResult(requestCode, resultCode, data);
}