Coming back from Camera Intent crashes Activity

后端 未结 3 1106
广开言路
广开言路 2021-01-25 06:54

I have an Activity that launches a Camera Intent like this (nothing special):

    Intent intent = new Intent(\"android.media.action.IMAGE_CAPTURE\");
    File ph         


        
3条回答
  •  温柔的废话
    2021-01-25 07:29

    If you don't really need landscape support for your application, you can also block the activity to portrait mode and you don't have to manage the orientation changes.. you can do that in manifest by setting the android:screenOrientation="portrait" attribute to your activity.

    If you want to have support for landscape too, then I'm afraid that you have to take a look at Brigham's answer .

提交回复
热议问题