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