本文整理匯總了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);
}