本文整理汇总了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);
}
}
示例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();
}
}
}
示例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();
}