surya
surya

Reputation: 109

how to disable camera function in android programatically

I want to disable camera in my android application pragmatically here i want to make an application in which once i start the application there is two button in start and stop in one when i click on the start button my application will go to home screen and will disable the camera function completely even on clicking on the camera icon in my application it wont enable and also by not clicking the hardware button unless until i again go back to my application and click on the stop button which will also go back to the home screen and this time my camera function of my phone will work properly

please help me out thanx's in advance

Upvotes: 2

Views: 15041

Answers (2)

Arun
Arun

Reputation: 385

private CheckBoxPreference mDisableCameraCheckbox;
DevicePolicyManager mDPM;
ComponentName mDeviceAdminSample;
...
mDPM.setCameraDisabled(mDeviceAdminSample, mDisableCameraCheckbox.isChecked());

Upvotes: 1

Nirav Tukadiya
Nirav Tukadiya

Reputation: 3417

You Can not disable camera in your regular application.but it is possible to disable using admin setting in ICS and higher versions..check it here http://developer.android.com/guide/topics/admin/device-admin.html

Upvotes: 0

Related Questions