I want to block the camera view . When I click on a simple button in my application, this deviceโs camera will be open and the camera should be locked until โ Landscape mode โ. Can anyone know a solution to this problem?
I use this code inside the action "CaptureImageActivity.java". Therefore, after performing this action, my system camera will open.
btn1.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { Intent i=new Intent(android.provider.MediaStore. ACTION_IMAGE_CAPTURE); i.putExtra(android.provider.MediaStore.EXTRA_SCREEN_ORIENTATION,ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); startActivityForResult(i,1000); } });
And I want to block this view of the camera in the "LandScape Mode". And according to the decision
<activity android:name=".CaptureImageActivity" android:screenOrientation="landscape" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity>
CaptureImageActivity is locked in LandScape mode.
source share