当前位置: 首页>>代码示例>>Java>>正文


Java Fragment.onActivityResult方法代码示例

本文整理汇总了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);
    }
}
 
开发者ID:Mun0n,项目名称:MADBike,代码行数:27,代码来源:HomeActivity.java

示例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;
    }
}
 
开发者ID:fivef,项目名称:add_to_evernote_note,代码行数:19,代码来源:NoteContainerFragment.java

示例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;
    }
}
 
开发者ID:fivef,项目名称:add_to_evernote_note,代码行数:19,代码来源:MainActivity.java

示例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?
    }
}
 
开发者ID:Anuken,项目名称:Mindustry,代码行数:18,代码来源:DonationsActivity.java

示例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);
    }
}
 
开发者ID:Adyen,项目名称:adyen-android,代码行数:11,代码来源:CheckoutActivity.java

示例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);
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:8,代码来源:ApplicationPreferencesActivity.java

示例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);
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:7,代码来源:RecipientPreferenceActivity.java

示例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);
        }
    }
}
 
开发者ID:picopalette,项目名称:event-me,代码行数:12,代码来源:MainActivity.java

示例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);
        }
    }
}
 
开发者ID:fengdongfei,项目名称:CXJPadProject,代码行数:13,代码来源:BFragment.java

示例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);
        }
    }
}
 
开发者ID:fengdongfei,项目名称:CXJPadProject,代码行数:13,代码来源:BFragment.java

示例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);
            }
        }
    }
}
 
开发者ID:sinhaDroid,项目名称:BlogBookApp,代码行数:14,代码来源:BaseActivity.java

示例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);
        }
    }
}
 
开发者ID:sinhaDroid,项目名称:BlogBookApp,代码行数:12,代码来源:BaseDialogFragment.java

示例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);
            }
        }
    }
}
 
开发者ID:sinhaDroid,项目名称:BlogBookApp,代码行数:15,代码来源:BaseFragment.java

示例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);
    }
}
 
开发者ID:humaniq,项目名称:humaniq-android,代码行数:9,代码来源:BaseActivity.java

示例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);
}
 
开发者ID:zeevy,项目名称:grblcontroller,代码行数:7,代码来源:MainActivity.java


注:本文中的android.support.v4.app.Fragment.onActivityResult方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。