protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); switch (requestCode) { case FILE_SELECT_CODE: if (resultCode == RESULT_OK) { imageSharing(data, "image"); } break; case CAMERA_REQUEST: if (resultCode == RESULT_OK) { imageSharing(data, "image"); } break; case VIDEO_REQUEST: if (resultCode == RESULT_OK) { imageSharing(data, "video"); } break; case AUDIO_REQUEST: if (resultCode == RESULT_OK) { imageSharing(data, "audio"); } break; case REQUEST_CONTACT_NUMBER: Log.d("REQUEST_CONTACT_NUMBER", "called"); if (data != null) { handlecontactBrowseData(data); } } }
// Need to add this here since the ZXing library creates a new activity from activity, not // fragment @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { IntentResult scanResult = IntentIntegrator.parseActivityResult(requestCode, resultCode, data); if (scanResult != null) { mCodeText = scanResult.getContents(); setCode(mCodeText); } else if (requestCode == VOICE_RECOGNITION_REQUEST_CODE) { if (resultCode == Activity.RESULT_OK) { ArrayList<String> textMatchList = data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS); if (!textMatchList.isEmpty()) { String text = textMatchList.get(0); TextView textView = (TextView) findViewById(R.id.cart_grocery_edit_name); textView.setText(text); } } else if (resultCode == RecognizerIntent.RESULT_AUDIO_ERROR) { makeToast("Audio error"); } else if (resultCode == RecognizerIntent.RESULT_CLIENT_ERROR) { makeToast("Client error"); } else if (resultCode == RecognizerIntent.RESULT_NETWORK_ERROR) { makeToast("Network error"); } else if (resultCode == RecognizerIntent.RESULT_NO_MATCH) { makeToast("Please repeat the item"); } else if (resultCode == RecognizerIntent.RESULT_SERVER_ERROR) { makeToast("Server error"); } } super.onActivityResult(requestCode, resultCode, data); }
@Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == ACTIVITY_RESULT_PREFERENCES) { if (resultCode == PreferencesActivity.RESULT_RESCAN) MediaLibrary.getInstance(this).loadMediaItems(this, true); } }
@Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); switch (requestCode) { case ADD_ACCOUNT_REQUEST: if (resultCode == RESULT_OK) { // new blog has been added, so rebuild cache of blogs and // setup current blog getBlogNames(); setupCurrentBlog(); initMenuDrawer(); mMenuDrawer.peekDrawer(0); } else { finish(); } break; case SETTINGS_REQUEST: if (resultCode == RESULT_OK) { if (mMenuDrawer != null) { updateMenuDrawer(); String[] blogNames = getBlogNames(); // If we need to add or remove the blog spinner, init the drawer again if ((blogNames.length > 1 && mListView.getHeaderViewsCount() == 0) || blogNames.length == 1 && mListView.getHeaderViewsCount() > 0) this.initMenuDrawer(); else if (blogNames.length > 1 && mBlogSpinner != null) { SpinnerAdapter mSpinnerAdapter = new ArrayAdapter<String>( getSupportActionBar().getThemedContext(), R.layout.sherlock_spinner_dropdown_item, blogNames); mBlogSpinner.setAdapter(mSpinnerAdapter); } if (blogNames.length >= 1) { setupCurrentBlog(); onBlogChanged(); } } } break; } }
@Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == REQUEST_AUTHENTICATE) { if (resultCode == RESULT_OK) { tryAuthenticate(); } else { // go back to previous step mHandler.post( new Runnable() { @Override public void run() { getSupportFragmentManager().popBackStack(); } }); } } else { super.onActivityResult(requestCode, resultCode, data); } }
@Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { // handle returning from image processing view. super.onActivityResult(requestCode, resultCode, data); }
@Override public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == REQUEST_PICK_ID) { if (resultCode == RESULT_OK) { ArrayList<String> names = data.getStringArrayListExtra("names"); ArrayList<String> types = data.getStringArrayListExtra("types"); ArrayList<String> hashes = data.getStringArrayListExtra("principal_hashes"); Log.d(TAG, "Names: " + names); Log.d(TAG, "Types: " + types); Log.d(TAG, "Hashes: " + hashes); // TODO: use the first returned account int i; for (i = 0; i < types.size(); i++) { if (types.get(i).equals(ACCOUNT_TYPE_STANFORD)) { break; } } if (i == types.size()) { i = 0; } for (int j = 0; j < names.size(); j++) { Util.saveAccount(this, names.get(j), hashes.get(j), types.get(j)); } Util.setPickedAccount(this, names.get(i), types.get(i), hashes.get(i)); if (Musubi.isMusubiInstalled(this)) { new CreateFeedsTask().execute(App.getDatabaseSource(this)); } } } else if (requestCode == REQUEST_CREATE_FEED) { if (resultCode == RESULT_OK) { Log.d(TAG, "got a feed start result"); Uri feedUri = data.getData(); if (feedUri != null) { // Single feed Log.d(TAG, "Feed URI: " + feedUri); } else if (data.getStringArrayListExtra("uris") != null && data.getStringArrayListExtra("principals") != null) { // Multiple feeds ArrayList<String> array = data.getStringArrayListExtra("uris"); ArrayList<String> principals = data.getStringArrayListExtra("principals"); LocationManager lm = new LocationManager(App.getDatabaseSource(this)); for (int i = 0; i < array.size(); i++) { Log.d(TAG, "Principal: " + principals.get(i)); List<MLocation> locs = lm.getLocationWithDuplicates(principals.get(i)); for (MLocation loc : locs) { if (loc != null) { loc.feedUri = Uri.parse(array.get(i)); Log.i(TAG, loc.feedUri.toString()); lm.updateLocation(loc); } } } } } } }