1

I am creating an app which uses the camera app to take pictures. Once I return from the camera app the entire view gets recreated. To stop this I have added

android:screenOrientation="portrait"
android:configChanges="orientation|keyboardHidden"

in the Manifest file for the specified activities. But this is still happening.

To be more precise of my issue, I am using Activity Group with TabHost. After a picture is taken using the camera I am redirecting the user to a different screen. But this is not working as the entire view is reloaded. Instead the user is taken back to the first screen in activity group.

I dont want this to happen. Is it posible to set orientation fro camera! How can I do this properly?

For those interested I am adding the code which I use to start camera

Intent camera = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
Uri pictureUri = Uri.fromFile(new File("/sdcard/myimage.jpg"));
camera.putExtra(MediaStore.EXTRA_OUTPUT, pictureUri);
this.getParent().startActivityForResult(camera, PICTURE_RESULT);

Thanks

Zach
  • 9,989
  • 19
  • 70
  • 107
  • you should use `startActivityForResult` – thepoosh Nov 07 '12 at 14:21
  • Thanks for your response. I have added the code I am using FYI. – Zach Nov 07 '12 at 14:24
  • Why are you using this.getParent() simply use this.startActivityForResult and define the method onActivityResult. – PravinCG Nov 07 '12 at 15:19
  • I am using an Activty group. startActivityForResult wont give a callback to a view inside the group but only to the parent of that view. Thats why I am using it. This post will explain it http://stackoverflow.com/questions/4268178/startactivityforresult-from-activitygroup – Zach Nov 07 '12 at 15:35
  • @Zach-Did you find the solution to this ? – Name is Nilay Apr 12 '14 at 09:49

0 Answers0