本文整理了Java中android.app.Activity.onActivityResult()
方法的一些代码示例,展示了Activity.onActivityResult()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Activity.onActivityResult()
方法的具体详情如下:
包路径:android.app.Activity
类名称:Activity
方法名:onActivityResult
暂无
代码示例来源:origin: commonsguy/cw-omnibus
@Override
protected void onActivityResult(int requestCode,
int resultCode, Intent data) {
isResolvingPlayServicesError=false;
super.onActivityResult(requestCode, resultCode, data);
}
代码示例来源:origin: commonsguy/cw-omnibus
@Override
protected void onActivityResult(int requestCode,
int resultCode, Intent data) {
isResolvingPlayServicesError=false;
super.onActivityResult(requestCode, resultCode, data);
}
代码示例来源:origin: facebook/facebook-android-sdk
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
mCallbackManager.onActivityResult(requestCode, resultCode, data);
if (requestCode == PICK_IMAGE && data != null) {
mAttachmentUri = data.getData();
}
}
代码示例来源:origin: aa112901/remusic
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
mPermissionHelper.onActivityResult(requestCode, resultCode, data);
}
代码示例来源:origin: facebook/facebook-android-sdk
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
callbackManager.onActivityResult(requestCode, resultCode, data);
}
代码示例来源:origin: facebook/facebook-android-sdk
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
mCallbackManager.onActivityResult(requestCode, resultCode, data);
}
代码示例来源:origin: facebook/facebook-android-sdk
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
mCallbackManager.onActivityResult(requestCode, resultCode, data);
}
代码示例来源:origin: libgdx/libgdx
@Override
protected void onActivityResult (int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
// forward events to our listeners if there are any installed
synchronized (androidEventListeners) {
for (int i = 0; i < androidEventListeners.size; i++) {
androidEventListeners.get(i).onActivityResult(requestCode, resultCode, data);
}
}
}
代码示例来源:origin: libgdx/libgdx
@Override
protected void onActivityResult (int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
// forward events to our listeners if there are any installed
synchronized (androidEventListeners) {
for (int i = 0; i < androidEventListeners.size; i++) {
androidEventListeners.get(i).onActivityResult(requestCode, resultCode, data);
}
}
}
代码示例来源:origin: bumptech/glide
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == REQUEST_CONTACT && resultCode == RESULT_OK) {
Uri uri = Preconditions.checkNotNull(data.getData());
final Cursor cursor = getContentResolver().query(uri, null, null, null, null);
try {
if (cursor != null && cursor.moveToFirst()) {
final long contactId = cursor.getLong(cursor.getColumnIndex(Contacts._ID));
showContact(contactId);
}
} finally {
if (cursor != null) {
cursor.close();
}
}
return;
}
super.onActivityResult(requestCode, resultCode, data);
}
代码示例来源:origin: anjlab/android-inapp-billing-v3
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (!bp.handleActivityResult(requestCode, resultCode, data))
super.onActivityResult(requestCode, resultCode, data);
}
代码示例来源:origin: crazycodeboy/TakePhoto
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
getTakePhoto().onActivityResult(requestCode, resultCode, data);
super.onActivityResult(requestCode, resultCode, data);
}
代码示例来源:origin: journeyapps/zxing-android-embedded
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
IntentResult result = IntentIntegrator.parseActivityResult(requestCode, resultCode, data);
if(result != null) {
if(result.getContents() == null) {
Toast.makeText(this, "Cancelled", Toast.LENGTH_LONG).show();
} else {
Toast.makeText(this, "Scanned: " + result.getContents(), Toast.LENGTH_LONG).show();
}
} else {
// This is important, otherwise the result will not be passed to the fragment
super.onActivityResult(requestCode, resultCode, data);
}
}
代码示例来源:origin: card-io/card.io-Android-SDK
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
setResult(resultCode, data);
finish();
}
}
代码示例来源:origin: TommyLemon/APIJSON
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (resultCode != RESULT_OK) {
return;
}
switch (requestCode) {
case REQUEST_TO_REQUEST:
if (data == null) {
Toast.makeText(context, "onActivityResult data == null !!!", Toast.LENGTH_SHORT).show();
} else {
result = data;
id = data.getLongExtra(RequestActivity.RESULT_ID, RequestUtil.DEFAULT_MOMENT_ID);
url = data.getStringExtra(RequestActivity.RESULT_URL);
tvAutoResponse.setText(StringUtil.getString(JSON.format(
data.getStringExtra(RequestActivity.RESULT_RESPONSE))));
}
break;
default:
break;
}
}
代码示例来源:origin: lyft/scissors
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == RequestCodes.PICK_IMAGE_FROM_GALLERY
&& resultCode == Activity.RESULT_OK) {
Uri galleryPictureUri = data.getData();
cropView.extensions()
.load(galleryPictureUri);
updateButtons();
}
}
代码示例来源:origin: CarGuo/GSYVideoPlayer
@RequiresApi(api = 23)
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (Build.VERSION.SDK_INT >= 23){
//todo 用23以上编译即可出现canDrawOverlays
if (Util.hasPermission(this)) {
mPermissionListener.onSuccess();
} else {
mPermissionListener.onFail();
}
}
finish();
}
代码示例来源:origin: robolectric/robolectric
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
activityResult = new ActivityResult(resultCode, data);
}
}
代码示例来源:origin: facebook/facebook-android-sdk
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (resultCode == RESULT_CANCELED) {
// We weren't able to open CustomTabMainActivity from the back stack. Send a broadcast
// instead.
Intent broadcast = new Intent(CUSTOM_TAB_REDIRECT_ACTION);
broadcast.putExtra(CustomTabMainActivity.EXTRA_URL, getIntent().getDataString());
LocalBroadcastManager.getInstance(this).sendBroadcast(broadcast);
// Wait for the custom tab to be removed from the back stack before finishing.
closeReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
CustomTabActivity.this.finish();
}
};
LocalBroadcastManager.getInstance(this).registerReceiver(
closeReceiver,
new IntentFilter(CustomTabActivity.DESTROY_ACTION)
);
}
}
代码示例来源:origin: yhaolpz/FloatWindow
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == 756232212) {
if (PermissionUtil.hasPermissionOnActivityResult(this)) {
mPermissionListener.onSuccess();
} else {
mPermissionListener.onFail();
}
}
finish();
}
内容来源于网络,如有侵权,请联系作者删除!