本文整理汇总了Java中org.androidannotations.annotations.OnActivityResult类的典型用法代码示例。如果您正苦于以下问题:Java OnActivityResult类的具体用法?Java OnActivityResult怎么用?Java OnActivityResult使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OnActivityResult类属于org.androidannotations.annotations包,在下文中一共展示了OnActivityResult类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onFileResult
import org.androidannotations.annotations.OnActivityResult; //导入依赖的package包/类
@OnActivityResult(FILE_DELETE_CODE)
void onFileResult(int resultCode, Intent data) {
Log.d("onFileResult", resultCode + "");
if (resultCode == Activity.RESULT_OK) {
AttachmentFileObject deletedFileObject = (AttachmentFileObject) data.getSerializableExtra("mAttachmentFileObject");
Log.d("onFileResult", resultCode + " " + deletedFileObject.getName());
for (AttachmentFileObject file : mData) {
if (file.file_id.equals(deletedFileObject.file_id)) {
mData.remove(file);
mAdapter.notifyDataSetChanged();
break;
}
}
setResult(Activity.RESULT_OK);
}
}
示例2: onFileMoveResult
import org.androidannotations.annotations.OnActivityResult; //导入依赖的package包/类
@OnActivityResult(FILE_MOVE_CODE)
void onFileMoveResult(int resultCode, Intent data) {
if (resultCode == Activity.RESULT_OK) {
AttachmentFolderObject selectedFolder = (AttachmentFolderObject) data.getSerializableExtra("mAttachmentFolderObject");
String param = "";
if (selectedFolder.file_id.equals(mAttachmentFolderObject.file_id)) {
return;
}
int i = 0;
for (AttachmentFileObject file : selectFile) {
if (i > 0) {
param += "&";
}
param += "fileId=" + file.file_id;
i++;
}
putNetwork(String.format(HOST_FILE_MOVETO, mProjectObjectId, selectedFolder.file_id, param), null, HOST_FILE_MOVETO);
}
}
示例3: onResultEditList
import org.androidannotations.annotations.OnActivityResult; //导入依赖的package包/类
@OnActivityResult(ListModify.RESULT_EDIT_LIST)
void onResultEditList(int resultCode, Intent data) {
if (resultCode == Activity.RESULT_OK) {
taskListParentUpdate();
String globarKey = data.getStringExtra(TaskAddActivity.RESULT_GLOBARKEY);
TaskObject.Members modifyMember = null;
for (int i = 0; i < mMembersAllAll.size(); ++i) {
if (mMembersAllAll.get(i).user.global_key.equals(globarKey)) {
modifyMember = mMembersAllAll.get(i);
break;
}
}
if (modifyMember != null) {
if (!mMembersAll.contains(modifyMember)) {
mMembersAll.add(modifyMember);
adapter.notifyDataSetChanged();
tabs.setViewPager(pager);
}
}
}
}
示例4: resultUserDetail
import org.androidannotations.annotations.OnActivityResult; //导入依赖的package包/类
@OnActivityResult(RESULT_USER_DETAIL)
protected final void resultUserDetail(int result, Intent data) {
if (result == RESULT_OK) {
Object object = data.getSerializableExtra("data");
if (object instanceof UserObject) {
UserObject user = (UserObject) object;
for (int i = 0; i < mData.size(); ++i) {
if (user.global_key.equals(mData.get(i).global_key)) {
mData.add(i, user);
mData.remove(i + 1);
baseAdapter.notifyDataSetChanged();
return;
}
}
}
}
}
示例5: onActivityResultSelectDirectoryToExport
import org.androidannotations.annotations.OnActivityResult; //导入依赖的package包/类
@OnActivityResult(REQUEST_CODE_SELECT_DIRECTORY_TO_EXPORT)
void onActivityResultSelectDirectoryToExport(int resultCode, Intent data) {
if (resultCode != RESULT_OK) {
return;
}
String path = data.getExtras().getString(DirectorySelectorActivity.RESULT_INTENT_PATH);
String defaultPath = String.format("%s/%s-%s.json",
path,
getResources().getString(R.string.app_name),
DateTimeUtils.getInstance().getCurrentDateTimeString());
activityHelper
.buildInputDialog(defaultPath, new MaterialDialog.ButtonCallback() {
@Override
public void onPositive(MaterialDialog materialDialog) {
TextView textView = (TextView) materialDialog.findViewById(android.R.id.text1);
String outputPath = textView.getText().toString();
exportCardsTo(outputPath);
}
})
.title(R.string.action_export)
.show();
}
示例6: onFilePicked
import org.androidannotations.annotations.OnActivityResult; //导入依赖的package包/类
@Background
@OnActivityResult(FilePickerHelper.ACTIVITY_FILEPICKER)
public void onFilePicked(int resultCode, Intent data) {
// We should have received an Intent with a local torrent's Uri as data from the file picker
if (data != null && data.getData() != null && !data.getData().toString().equals("")) {
Uri dataUri = data.getData();
// Get torrent title
String title = NavigationHelper.extractNameFromUri(dataUri);
// Adding a torrent from the via a content:// scheme (access through content provider stream)
if (dataUri.getScheme().equals(ContentResolver.SCHEME_CONTENT)) {
addTorrentFromDownloads(dataUri, title);
return;
}
// Adding a .torrent file directly via the file:// scheme (we can access it directly)
if (dataUri.getScheme().equals("file")) {
addTorrentByFile(data.getDataString(), title);
}
}
}
示例7: onQrCodeScanned
import org.androidannotations.annotations.OnActivityResult; //导入依赖的package包/类
@OnActivityResult(BarcodeHelper.ACTIVITY_BARCODE_QRSETTINGS)
public void onQrCodeScanned(@SuppressWarnings("UnusedParameters") int resultCode, Intent data) {
// We should have received Intent extras with the QR-decoded data representing Transdroid settings
if (data == null || !data.hasExtra("SCAN_RESULT"))
return; // Cancelled scan; ignore
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(SystemSettingsActivity.this);
String contents = data.getStringExtra("SCAN_RESULT");
String formatName = data.getStringExtra("SCAN_RESULT_FORMAT");
if (formatName != null && formatName.equals("QR_CODE") && !TextUtils.isEmpty(contents)) {
try {
settingsPersistence.importSettingsAsString(prefs, contents);
SnackbarManager.show(Snackbar.with(SystemSettingsActivity.this).text(R.string.pref_import_success));
} catch (JSONException e) {
SnackbarManager
.show(Snackbar.with(SystemSettingsActivity.this).text(R.string.error_file_not_found).colorResource(R.color.red));
}
}
}
示例8: onResult
import org.androidannotations.annotations.OnActivityResult; //导入依赖的package包/类
@OnActivityResult(REQUEST_CODE)
public void onResult(int resultCode, Intent intent) {
if (resultCode == RESULT_OK) {
uri = intent.getData();
displayFromUri(uri);
}
}
示例9: resultUserDetail
import org.androidannotations.annotations.OnActivityResult; //导入依赖的package包/类
@OnActivityResult(RESULT_USER_DETAIL)
final void resultUserDetail(int result, Intent data) {
if (result == Activity.RESULT_OK) {
UserObject userObject = (UserObject) data.getSerializableExtra("data");
for (int i = 0; i < mUserList.size(); ++i) {
if (mUserList.get(i).id == userObject.id) {
mUserList.remove(i);
mUserList.add(i, userObject);
mAdapter.notifyDataSetChanged();
return;
}
}
}
}
示例10: onResultPickMember
import org.androidannotations.annotations.OnActivityResult; //导入依赖的package包/类
@OnActivityResult(RESULT_REQUEST_SELECT_USER)
void onResultPickMember(int result, Intent intent) {
if (result == RESULT_OK) {
mUser = (TaskObject.Members) intent.getSerializableExtra("members");
updatePickMemberDisplay();
}
}
示例11: resultPickSearch
import org.androidannotations.annotations.OnActivityResult; //导入依赖的package包/类
@OnActivityResult(RESULT_PROJECT_SEARCH_PICK)
final void resultPickSearch(int result, Intent intent) {
if (result == Activity.RESULT_OK) {
// ProjectObject projectObject = (ProjectObject) intent.getSerializableExtra("data");
// Intent intent1 = new Intent();
// intent1.putExtra("data", proj);
getActivity().setResult(Activity.RESULT_OK, intent);
getActivity().finish();
}
}
示例12: onResultLabel
import org.androidannotations.annotations.OnActivityResult; //导入依赖的package包/类
@OnActivityResult(RESULT_LABEL)
protected void onResultLabel(int code, @OnActivityResult.Extra ArrayList<TopicLabelObject> labels) {
if (code == RESULT_OK) {
modifyData.labels = labels;
editFragment.updateLabels(modifyData.labels);
previewFragment.updateLabels(modifyData.labels);
labelsHasChanged = true;
saveLabelsIfCancel();
}
}
示例13: onResultPickColor
import org.androidannotations.annotations.OnActivityResult; //导入依赖的package包/类
@OnActivityResult(RESULT_PICK_COLOR)
void onResultPickColor(int result, @OnActivityResult.Extra int resultData) {
if (result == RESULT_OK) {
generateColor = resultData;
updateColorPreview();
}
}
示例14: onResultModify
import org.androidannotations.annotations.OnActivityResult; //导入依赖的package包/类
@OnActivityResult(RESULT_MODIFY)
void onResultModify(int result, @OnActivityResult.Extra TopicLabelObject resultData) {
if (result == RESULT_OK) {
if (allLabels.containsKey(currentLabelId)) {
TopicLabelObject topicLabelObject = allLabels.get(currentLabelId);
topicLabelObject.name = resultData.name;
topicLabelObject.color = resultData.color;
}
updateList();
}
unlockViews();
}
示例15: onResultPickColor
import org.androidannotations.annotations.OnActivityResult; //导入依赖的package包/类
@OnActivityResult(RESULT_PICK_COLOR)
void onResultPickColor(int result, @OnActivityResult.Extra int resultData) {
if (result == RESULT_OK) {
labelObject.color = resultData;
updateColorPreview();
}
}