onactivityresult

Camera Intent return null only on some devices

旧街凉风 提交于 2019-12-12 02:59:46
问题 I am using camera to capture image and set the returned bitmap into an imageview but it is crashing on OnePlus devices. I checked on few htc devices and it is working perfectly. I checked for solutions and they said to check for request code but I am already doing it. What can be the problem here? Here is the code imageView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);

Releasing camera instance after a single image is captured and returning to parent activity

守給你的承諾、 提交于 2019-12-12 01:55:09
问题 I am trying to call camera instance, capture an image and return to the parent activity. I am able to create and call the camera instance, capture and store the image, but the activity with the camera does not exit. The Preview activity creates a camera instance and implements methods like onPause() , onResume() and resetCam() . The code is: //capture button buttonClick.setOnClickListener(new OnClickListener(){ public void onClick(View v) { camera.takePicture(shutterCallback, rawCallback,

Make uploaded image remain after layout/Activity change

淺唱寂寞╮ 提交于 2019-12-12 01:49:23
问题 I am still a rookie in terms of java and android programming, I believe I have come far in the last weeks but now I'm a little bit stuck and I would really appreciate your help. I am trying to develop an app that can create a User profile Layout. So far I have it ready, drawing the user's data from a web service. But now I have to add a way for the user to upload his photo from gallery or camera. So far I have achieved this with the next code: public void loadimage (View view) { Intent intent

Failure delivering result ResultInfo{who=null, request=1, result=-1, data=Intent { dat=content://com.android.contacts/contacts/lookup…}}

♀尐吖头ヾ 提交于 2019-12-11 23:16:41
问题 Error while i choose a contact from the contact list . Any help from you will be nice ... Here is the code for receiving number from contact and showing it in edit text view : private void importContact() { Intent importContactIntent = new Intent(Intent.ACTION_PICK); importContactIntent.setType(ContactsContract.Contacts.CONTENT_TYPE); startActivityForResult(importContactIntent, PICK_CONTACT); } @Override public void onActivityResult(int reqCode, int resultCode, Intent data) { super

How to Call onActivityResult in adapter listview?

自古美人都是妖i 提交于 2019-12-11 20:32:33
问题 i'm learning how to change Single item with resultActivity in in my custom Adapter listview. how it's can work ? this my code when startActivityForResult in custom adapter listview holder.isi_layout.setOnClickListener(new android.view.View.OnClickListener(){ public void onClick(View v) { Intent i = null; i = new Intent(activity, DetailLaporanActivity.class); Bundle b = new Bundle(); b.putString("position", Integer.toString(position)); i.putExtras(b); activity.startActivityForResult(i,

Android on activity result always return 0 and null intent

和自甴很熟 提交于 2019-12-11 19:23:50
问题 I tried almost all solutions found from the net and still can't solve my problem. Would anyone please help with the following codes? I really can't make it work. Even if I tried to put the setresult code in onBackPressed event, the parent activity still get result code = 0. Start activity for result in the parent [CreatePostActivity] on touch event of a spinner: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mContext = this; appState = (

onActivityResult isn't called for startActivityForResult

坚强是说给别人听的谎言 提交于 2019-12-11 17:15:12
问题 I have a MainActivity with an options menu with a 'settings' item. When I start the SettingsActivity , all works fine until I click the save button and try to finish the SettingsActivity . This activity ends but it appears to close the parent activity also. I'm working on this in Eclipse. Eclipse says that the something is still running because it allows me to click the stop button. I do have a timer thread running in MainActivity , but I tested this without that thread and it still doesn't

onActivityResult result code is zero also when the user click OK

久未见 提交于 2019-12-11 16:59:06
问题 GOAL: when the user opens the app and the GPS is off a dialog has to show and ask him to turn GPS on. PROBLEM: the result code passed to onActivityResult hasn't a consistent value. I mean: when I run the app and I click ok quickly on the alert dialog, resultCode is 0 (like if I'd clicked cancel) when I'm in debugging mode, I step through the code slower and I click ok on the alert dialog, resultCode become -1 (as expected) QUESTION: can you help me to find what's the root of this problem

Getting null in onActivityResult by taking picture from Camera

帅比萌擦擦* 提交于 2019-12-11 16:13:04
问题 I created a class to take picture from camera in my application. This class will take a picture with camera and store it in a folder with an unique name. But when I want to get picture path in onActivityResult method Iget null of data all the time! this is my class Camera: public class Camera{ private Activity activity; private SystemTools systemTools; public Camera(Context context) { this.activity = (Activity) context; systemTools = new SystemTools(); } /** * This Method will take a picture

onActivityResult not being trigger from Alert Dialog FIXED

£可爱£侵袭症+ 提交于 2019-12-11 13:04:09
问题 Im adding the ability to upload videos in addition to photos in my app. To accomplish this, now when you click the attach button b2 instead of the image chooser loading it loads an alert dialog showDialog() to ask which you would like to upload (video or photo) upon selecting, it then loads the image or video selector. Problem is now when you call the method doPositiveClick(Activity activity, int requestCode) from the inner class onActivityResult is not being triggered and no data being