android Programming Glossary: onactivityresult
Android, How to manage start activity for result? http://stackoverflow.com/questions/10407159/android-how-to-manage-start-activity-for-result Now in your FirstActivity class write following code for onActivityResult method protected void onActivityResult int requestCode int resultCode.. following code for onActivityResult method protected void onActivityResult int requestCode int resultCode Intent data if requestCode 1..
Android ACTION_IMAGE_CAPTURE Intent http://stackoverflow.com/questions/1910608/android-action-image-capture-intent i do different things based on the device. protected void onActivityResult int requestCode int resultCode Intent intent switch requestCode..
Using ZXing to create an android barcode scanning app http://stackoverflow.com/questions/2050263/using-zxing-to-create-an-android-barcode-scanning-app QR_CODE_MODE startActivityForResult intent 0 public void onActivityResult int requestCode int resultCode Intent intent if requestCode..
Get/pick an image from Android's built-in Gallery app programmatically http://stackoverflow.com/questions/2169649/get-pick-an-image-from-androids-built-in-gallery-app-programmatically intent Select Picture SELECT_PICTURE public void onActivityResult int requestCode int resultCode Intent data if resultCode RESULT_OK..
How to return a result (startActivityForResult) from a TabHost Activity? http://stackoverflow.com/questions/2497205/how-to-return-a-result-startactivityforresult-from-a-tabhost-activity SOMETHING EXTRAS this.setResult RESULT_OK intent finish onActivityResult is called in Class A but the resultCode is RESULT_CANCELED instead..
How to pick an image from gallery (SD Card) for my app in Android? http://stackoverflow.com/questions/2507898/how-to-pick-an-image-from-gallery-sd-card-for-my-app-in-android Here's some sample code on how to do that protected void onActivityResult int requestCode int resultCode Intent imageReturnedIntent super.onActivityResult.. int resultCode Intent imageReturnedIntent super.onActivityResult requestCode resultCode imageReturnedIntent switch requestCode..
Android camera intent http://stackoverflow.com/questions/2729267/android-camera-intent intent TAKE_PICTURE @Override public void onActivityResult int requestCode int resultCode Intent data super.onActivityResult.. int requestCode int resultCode Intent data super.onActivityResult requestCode resultCode data switch requestCode case TAKE_PICTURE..
Service discovery failed exception using Bluetooth on Android http://stackoverflow.com/questions/3397071/service-discovery-failed-exception-using-bluetooth-on-android is almost identical to the Bluetooth Chat App. public void onActivityResult int requestCode int resultCode Intent data if m_BluetoothAdapter.isEnabled..
Get filename and path from uri from mediastore http://stackoverflow.com/questions/3401579/get-filename-and-path-from-uri-from-mediastore filename and path from uri from mediastore I have an onActivityResult returning from an mediastore image selection which I can get..
File Upload in WebView http://stackoverflow.com/questions/5907369/file-upload-in-webview int FILECHOOSER_RESULTCODE 1 @Override protected void onActivityResult int requestCode int resultCode Intent intent if requestCode..
Capture Image from Camera and Display in Activity http://stackoverflow.com/questions/5991319/capture-image-from-camera-and-display-in-activity cameraIntent CAMERA_REQUEST protected void onActivityResult int requestCode int resultCode Intent data if requestCode CAMERA_REQUEST..
Deleting a gallery image after camera intent photo taken http://stackoverflow.com/questions/6390163/deleting-a-gallery-image-after-camera-intent-photo-taken intent CAMERA_PIC_REQUEST protected void onActivityResult int requestCode int resultCode Intent data super.onActivityResult.. int requestCode int resultCode Intent data super.onActivityResult requestCode resultCode data if requestCode CAMERA_PIC_REQUEST.. and the activity comes back here is my code protected void onActivityResult int requestCode int resultCode Intent data if requestCode IMAGE_CAPTURE..
Android: How to declare global variables? http://stackoverflow.com/questions/708012/android-how-to-declare-global-variables ... loadSettings if strSessionString null login ... The onActivityResult method which is executed when the login form terminates looks.. form terminates looks like this @Override public void onActivityResult int requestCode int resultCode Intent data super.onActivityResult.. int requestCode int resultCode Intent data super.onActivityResult requestCode resultCode data switch requestCode case SHOW_SUBACTICITY_LOGIN..
Update data in ListFragment as part of ViewPager http://stackoverflow.com/questions/7379165/update-data-in-listfragment-as-part-of-viewpager mPager.setAdapter mAdapter @Override protected void onActivityResult int requestCode int resultCode Intent data ... updateFragments..
How to call Android contacts list? http://stackoverflow.com/questions/866769/how-to-call-android-contacts-list for the Result Also in your Activity override the onActivityResult method to listen for the return from the 'select a contact'.. the name from the returned cursor. @Override public void onActivityResult int reqCode int resultCode Intent data super.onActivityResult.. int reqCode int resultCode Intent data super.onActivityResult reqCode resultCode data switch reqCode case PICK_CONTACT if..
OnActivityResult is not working in TabActivityGroup? http://stackoverflow.com/questions/10777154/onactivityresult-is-not-working-in-tabactivitygroup is not working in TabActivityGroup I am using Tab Activity..
Calendar event intent - startActivityForResult http://stackoverflow.com/questions/11508511/calendar-event-intent-startactivityforresult REQUEST_ID Is it possible to get ID of created event OnActivityResult resultCode is always 0 whether I create event or not. data is..
Camera Force Closing issue in Samsung Galaxy S3 version 4.1.1 http://stackoverflow.com/questions/14495304/camera-force-closing-issue-in-samsung-galaxy-s3-version-4-1-1 intent Complete action using PICK_FROM_FILE Inside OnActivityResult Method case PICK_FROM_CAMERA Log.i TAG Inside PICK_FROM_CAMERA..
camera intent data null in onActivityResult(int requestCode, int resultCode, Intent data) in Samsung S3 http://stackoverflow.com/questions/14627900/camera-intent-data-null-in-onactivityresultint-requestcode-int-resultcode-int PICK_FROM_CAMERA And Get your URI by Below way inside OnActivityResult Method if resultCode RESULT_OK return switch requestCode case..
Install APK programmatically on android http://stackoverflow.com/questions/6362479/install-apk-programmatically-on-android installation the user clicks on Open instead of Done the OnActivityResult method is not called as the manager still exists.... and this..
access to full resolution pictures from camera with MonoDroid http://stackoverflow.com/questions/8068156/access-to-full-resolution-pictures-from-camera-with-monodroid intent TAKE_PICTURE protected override void OnActivityResult int requestCode Result resultCode Intent data base.OnActivityResult.. int requestCode Result resultCode Intent data base.OnActivityResult requestCode resultCode data if requestCode TAKE_PICTURE Uri.. name and path i specified for it. When i save the picture OnActivityResult is called but its Intent data parameter contains an empty intent...
Android Camera : data intent returns null http://stackoverflow.com/questions/9890757/android-camera-data-intent-returns-null photoIntent IMAGE_CAPTURE In the same activity I call the OnActivityResult method for the image result @Override protected void onActivityResult.. .show The problem is that the intent data is null and the OnActivityResult method turns directly to the resultCode RESULT_CANCELED and..
Android, How to manage start activity for result? http://stackoverflow.com/questions/10407159/android-how-to-manage-start-activity-for-result new Intent setResult RESULT_CANCELED returnIntent finish Now in your FirstActivity class write following code for onActivityResult method protected void onActivityResult int requestCode int resultCode Intent data if requestCode 1 if resultCode RESULT_OK.. returnIntent finish Now in your FirstActivity class write following code for onActivityResult method protected void onActivityResult int requestCode int resultCode Intent data if requestCode 1 if resultCode RESULT_OK String result data.getStringExtra result..
Android ACTION_IMAGE_CAPTURE Intent http://stackoverflow.com/questions/1910608/android-action-image-capture-intent i mRequestCode then in activity that i return to i do different things based on the device. protected void onActivityResult int requestCode int resultCode Intent intent switch requestCode case GlobalConstants.IMAGE_CAPTURE Uri u if hasImageCaptureBug..
Using ZXing to create an android barcode scanning app http://stackoverflow.com/questions/2050263/using-zxing-to-create-an-android-barcode-scanning-app intent.putExtra SCAN_MODE QR_CODE_MODE startActivityForResult intent 0 public void onActivityResult int requestCode int resultCode Intent intent if requestCode 0 if resultCode RESULT_OK String contents intent.getStringExtra..
Get/pick an image from Android's built-in Gallery app programmatically http://stackoverflow.com/questions/2169649/get-pick-an-image-from-androids-built-in-gallery-app-programmatically startActivityForResult Intent.createChooser intent Select Picture SELECT_PICTURE public void onActivityResult int requestCode int resultCode Intent data if resultCode RESULT_OK if requestCode SELECT_PICTURE Uri selectedImageUri..
How to return a result (startActivityForResult) from a TabHost Activity? http://stackoverflow.com/questions/2497205/how-to-return-a-result-startactivityforresult-from-a-tabhost-activity regular Activity Intent intent this.getIntent intent.putExtra SOMETHING EXTRAS this.setResult RESULT_OK intent finish onActivityResult is called in Class A but the resultCode is RESULT_CANCELED instead of RESULT_OK and the returned intent is null. How do..
How to pick an image from gallery (SD Card) for my app in Android? http://stackoverflow.com/questions/2507898/how-to-pick-an-image-from-gallery-sd-card-for-my-app-in-android but they didn't explain well how to handle the response. Here's some sample code on how to do that protected void onActivityResult int requestCode int resultCode Intent imageReturnedIntent super.onActivityResult requestCode resultCode imageReturnedIntent.. code on how to do that protected void onActivityResult int requestCode int resultCode Intent imageReturnedIntent super.onActivityResult requestCode resultCode imageReturnedIntent switch requestCode case REQ_CODE_PICK_IMAGE if resultCode RESULT_OK Uri selectedImage..
Android camera intent http://stackoverflow.com/questions/2729267/android-camera-intent Uri.fromFile photo imageUri Uri.fromFile photo startActivityForResult intent TAKE_PICTURE @Override public void onActivityResult int requestCode int resultCode Intent data super.onActivityResult requestCode resultCode data switch requestCode case TAKE_PICTURE.. intent TAKE_PICTURE @Override public void onActivityResult int requestCode int resultCode Intent data super.onActivityResult requestCode resultCode data switch requestCode case TAKE_PICTURE if resultCode Activity.RESULT_OK Uri selectedImage imageUri..
Service discovery failed exception using Bluetooth on Android http://stackoverflow.com/questions/3397071/service-discovery-failed-exception-using-bluetooth-on-android that and then does the connect to it. The code beneath is almost identical to the Bluetooth Chat App. public void onActivityResult int requestCode int resultCode Intent data if m_BluetoothAdapter.isEnabled m_BluetoothAdapter.enable switch requestCode..
Get filename and path from uri from mediastore http://stackoverflow.com/questions/3401579/get-filename-and-path-from-uri-from-mediastore filename and path from uri from mediastore I have an onActivityResult returning from an mediastore image selection which I can get a URI for an image using the following Uri selectedImage data.getData..
File Upload in WebView http://stackoverflow.com/questions/5907369/file-upload-in-webview private ValueCallback Uri mUploadMessage private final static int FILECHOOSER_RESULTCODE 1 @Override protected void onActivityResult int requestCode int resultCode Intent intent if requestCode FILECHOOSER_RESULTCODE if null mUploadMessage return Uri..
Capture Image from Camera and Display in Activity http://stackoverflow.com/questions/5991319/capture-image-from-camera-and-display-in-activity android.provider.MediaStore.ACTION_IMAGE_CAPTURE startActivityForResult cameraIntent CAMERA_REQUEST protected void onActivityResult int requestCode int resultCode Intent data if requestCode CAMERA_REQUEST resultCode RESULT_OK Bitmap photo Bitmap data.getExtras..
Deleting a gallery image after camera intent photo taken http://stackoverflow.com/questions/6390163/deleting-a-gallery-image-after-camera-intent-photo-taken intent.putExtra MediaStore.EXTRA_OUTPUT outputFileUri startActivityForResult intent CAMERA_PIC_REQUEST protected void onActivityResult int requestCode int resultCode Intent data super.onActivityResult requestCode resultCode data if requestCode CAMERA_PIC_REQUEST.. intent CAMERA_PIC_REQUEST protected void onActivityResult int requestCode int resultCode Intent data super.onActivityResult requestCode resultCode data if requestCode CAMERA_PIC_REQUEST resultCode 1 Intent intent new Intent com.android.camera.action.CROP.. intent IMAGE_CAPTURE Once this is done and the activity comes back here is my code protected void onActivityResult int requestCode int resultCode Intent data if requestCode IMAGE_CAPTURE based on the result we either set the preview or..
Android: How to declare global variables? http://stackoverflow.com/questions/708012/android-how-to-declare-global-variables savedInstanceState setContentView R.layout.main ... loadSettings if strSessionString null login ... The onActivityResult method which is executed when the login form terminates looks like this @Override public void onActivityResult int requestCode.. ... The onActivityResult method which is executed when the login form terminates looks like this @Override public void onActivityResult int requestCode int resultCode Intent data super.onActivityResult requestCode resultCode data switch requestCode case SHOW_SUBACTICITY_LOGIN.. terminates looks like this @Override public void onActivityResult int requestCode int resultCode Intent data super.onActivityResult requestCode resultCode data switch requestCode case SHOW_SUBACTICITY_LOGIN if resultCode Activity.RESULT_OK strSessionString..
Update data in ListFragment as part of ViewPager http://stackoverflow.com/questions/7379165/update-data-in-listfragment-as-part-of-viewpager mPager ViewPager findViewById R.id.viewpager mPager.setAdapter mAdapter @Override protected void onActivityResult int requestCode int resultCode Intent data ... updateFragments ... public void updateFragments Attempt 1 mAdapter.notifyDataSetChanged..
How to call Android contacts list? http://stackoverflow.com/questions/866769/how-to-call-android-contacts-list or canceled . startActivityForResult intent PICK_CONTACT 3 Listening for the Result Also in your Activity override the onActivityResult method to listen for the return from the 'select a contact' Activity you launched in step 2. You should check that the returned.. you need to use that URI to create a new query and extract the name from the returned cursor. @Override public void onActivityResult int reqCode int resultCode Intent data super.onActivityResult reqCode resultCode data switch reqCode case PICK_CONTACT if.. the name from the returned cursor. @Override public void onActivityResult int reqCode int resultCode Intent data super.onActivityResult reqCode resultCode data switch reqCode case PICK_CONTACT if resultCode Activity.RESULT_OK Uri contactData data.getData Cursor..
OnActivityResult is not working in TabActivityGroup? http://stackoverflow.com/questions/10777154/onactivityresult-is-not-working-in-tabactivitygroup is not working in TabActivityGroup I am using Tab Activity as a main Activity in which it has 4 tabs. One tab is Activity..
Calendar event intent - startActivityForResult http://stackoverflow.com/questions/11508511/calendar-event-intent-startactivityforresult vnd.android.cursor.item event startActivityForResult intent REQUEST_ID Is it possible to get ID of created event OnActivityResult resultCode is always 0 whether I create event or not. data is always null. Is there some way how to do it android android..
Camera Force Closing issue in Samsung Galaxy S3 version 4.1.1 http://stackoverflow.com/questions/14495304/camera-force-closing-issue-in-samsung-galaxy-s3-version-4-1-1 startActivityForResult Intent.createChooser intent Complete action using PICK_FROM_FILE Inside OnActivityResult Method case PICK_FROM_CAMERA Log.i TAG Inside PICK_FROM_CAMERA Final Code As Below try Log.i TAG inside Samsung Phones..
camera intent data null in onActivityResult(int requestCode, int resultCode, Intent data) in Samsung S3 http://stackoverflow.com/questions/14627900/camera-intent-data-null-in-onactivityresultint-requestcode-int-resultcode-int MediaStore.ACTION_IMAGE_CAPTURE startActivityForResult intent PICK_FROM_CAMERA And Get your URI by Below way inside OnActivityResult Method if resultCode RESULT_OK return switch requestCode case PICK_FROM_CAMERA Log.i TAG Inside PICK_FROM_CAMERA Describe..
Install APK programmatically on android http://stackoverflow.com/questions/6362479/install-apk-programmatically-on-android But the issue that I'm having is that if at the end of the installation the user clicks on Open instead of Done the OnActivityResult method is not called as the manager still exists.... and this presents another issue on another requirement on the system...
access to full resolution pictures from camera with MonoDroid http://stackoverflow.com/questions/8068156/access-to-full-resolution-pictures-from-camera-with-monodroid Android.Provider.MediaStore.ExtraOutput fileUri StartActivityForResult intent TAKE_PICTURE protected override void OnActivityResult int requestCode Result resultCode Intent data base.OnActivityResult requestCode resultCode data if requestCode TAKE_PICTURE.. intent TAKE_PICTURE protected override void OnActivityResult int requestCode Result resultCode Intent data base.OnActivityResult requestCode resultCode data if requestCode TAKE_PICTURE Uri imageUri null Check if the result includes a thumbnail Bitmap.. to the default DCIM folder on the device ignoring the file name and path i specified for it. When i save the picture OnActivityResult is called but its Intent data parameter contains an empty intent. how do i get access to the full resolution picture and..
Android Camera : data intent returns null http://stackoverflow.com/questions/9890757/android-camera-data-intent-returns-null MediaStore.ACTION_IMAGE_CAPTURE startActivityForResult photoIntent IMAGE_CAPTURE In the same activity I call the OnActivityResult method for the image result @Override protected void onActivityResult int requestCode int resultCode Intent data if requestCode.. Toast.makeText this CANCELED Toast.LENGTH_LONG .show The problem is that the intent data is null and the OnActivityResult method turns directly to the resultCode RESULT_CANCELED and the application returns to the previous avtivity. How can I..
|