當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。