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


Java Activity.RESULT_FIRST_USER属性代码示例

本文整理汇总了Java中android.app.Activity.RESULT_FIRST_USER属性的典型用法代码示例。如果您正苦于以下问题:Java Activity.RESULT_FIRST_USER属性的具体用法?Java Activity.RESULT_FIRST_USER怎么用?Java Activity.RESULT_FIRST_USER使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在android.app.Activity的用法示例。


在下文中一共展示了Activity.RESULT_FIRST_USER属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onActivityResult

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
	if (resultCode == Activity.RESULT_FIRST_USER && requestCode == SETTINGS_ACTIVITY) {
		if (data.getExtras().getBoolean("Exit", false)) {
			quit();
		} else {
			pendingFragmentTransaction = (FragmentsAvailable) data.getExtras().getSerializable("FragmentToDisplay");
		}
	} else if (resultCode == Activity.RESULT_FIRST_USER && requestCode == CALL_ACTIVITY) {
		getIntent().putExtra("PreviousActivity", CALL_ACTIVITY);
		callTransfer = data == null ? false : data.getBooleanExtra("Transfer", false);
		boolean chat = data == null ? false : data.getBooleanExtra("chat", false);
		if(chat){
			pendingFragmentTransaction = FragmentsAvailable.CHAT_LIST;
		}
		if (LinphoneManager.getLc().getCallsNb() > 0) {
			initInCallMenuLayout(callTransfer);
		} else {
			resetClassicMenuLayoutAndGoBackToCallIfStillRunning();
		}
	} else if (requestCode == PERMISSIONS_REQUEST_OVERLAY) {
		if (Compatibility.canDrawOverlays(this)) {
			LinphonePreferences.instance().enableOverlay(true);
		}
	} else {
		super.onActivityResult(requestCode, resultCode, data);
	}
}
 
开发者ID:treasure-lau,项目名称:Linphone4Android,代码行数:28,代码来源:LinphoneActivity.java

示例2: onActivityResult

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (resultCode == Activity.RESULT_CANCELED || resultCode == Activity.RESULT_FIRST_USER) {
        return;
    }
    if (resultCode == Activity.RESULT_OK) {
        if (requestCode == REQUEST_PICK_PICTURE || requestCode == REQUEST_CROP_PICTURE) {
            getFragmentManager().popBackStack();
        }
    }
}
 
开发者ID:shenhuanet,项目名称:Ocr-android,代码行数:12,代码来源:TakePicFragment.java

示例3: onActivityResult

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    switch (requestCode) {
        case REQUEST_CODE_INSTALL:
            /**
             * resultCode is always 0 on Android < 4.0. See
             * com.android.packageinstaller.PackageInstallerActivity: setResult is
             * never executed on Androids < 4.0
             */
            if (Build.VERSION.SDK_INT < 14) {
                installer.sendBroadcastInstall(downloadUri, Installer.ACTION_INSTALL_COMPLETE);
                break;
            }

            switch (resultCode) {
                case Activity.RESULT_OK:
                    installer.sendBroadcastInstall(downloadUri,
                            Installer.ACTION_INSTALL_COMPLETE);
                    break;
                case Activity.RESULT_CANCELED:
                    installer.sendBroadcastInstall(downloadUri,
                            Installer.ACTION_INSTALL_INTERRUPTED);
                    break;
                case Activity.RESULT_FIRST_USER:
                default:
                    // AOSP returns Activity.RESULT_FIRST_USER on error
                    installer.sendBroadcastInstall(downloadUri,
                            Installer.ACTION_INSTALL_INTERRUPTED,
                            getString(R.string.install_error_unknown));
                    break;
            }

            break;
        case REQUEST_CODE_UNINSTALL:
            // resultCode is always 0 on Android < 4.0.
            if (Build.VERSION.SDK_INT < 14) {
                installer.sendBroadcastUninstall(Installer.ACTION_UNINSTALL_COMPLETE);
                break;
            }

            switch (resultCode) {
                case Activity.RESULT_OK:
                    installer.sendBroadcastUninstall(Installer.ACTION_UNINSTALL_COMPLETE);
                    break;
                case Activity.RESULT_CANCELED:
                    installer.sendBroadcastUninstall(Installer.ACTION_UNINSTALL_INTERRUPTED);
                    break;
                case Activity.RESULT_FIRST_USER:
                default:
                    // AOSP UninstallAppProgress returns RESULT_FIRST_USER on error
                    installer.sendBroadcastUninstall(Installer.ACTION_UNINSTALL_INTERRUPTED,
                            getString(R.string.uninstall_error_unknown));
                    break;
            }

            break;
        default:
            throw new RuntimeException("Invalid request code!");
    }

    // after doing the broadcasts, finish this transparent wrapper activity
    finish();
}
 
开发者ID:uhuru-mobile,项目名称:mobile-store,代码行数:63,代码来源:DefaultInstallerActivity.java


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