Sumit Pansuriya
Sumit Pansuriya

Reputation: 553

com.android.camera.NEW_PICTURE is deprecated for all apps Android N?

I have used com.android.camera.NEW_PICTURE & android.hardware.action.NEW_PICTURE to check whether an image is captured or not in my app.

But it's getting warning com.android.camera.NEW_PICTURE is deprecated for all apps starting with the Android N release to target SDK

How can I resolve it? Can any one help me for Android N.

My code is

 **<receiver android:name=".receiver.CameraReceiver"
           android:enabled="true">
 <intent-filter android:priority="10000">
 <action android:name="android.intent.action.CAMERA_BUTTON" />
 <action android:name="com.android.camera.NEW_PICTURE" />
 <action android:name="android.hardware.action.NEW_PICTURE" />
 <category android:name="android.intent.category.DEFAULT" />
 <data android:mimeType="image/*" />
 </intent-filter>
 </receiver>**

Thanks.

Upvotes: 0

Views: 1701

Answers (1)

Samuele Pontremoli
Samuele Pontremoli

Reputation: 594

The Documentation states that it's deprecated in Android N. Relevant part of the docs:

In Android N this broadcast was removed, and applications are recommended to use JobInfo.Builder.addTriggerContentUri(JobInfo.TriggerContentUri) instead.

In Android O this broadcast has been brought back, but only for registered receivers. Apps that are actively running can again listen to the broadcast if they want an immediate clear signal about a picture being taken, however anything doing heavy work (or needing to be launched) as a result of this should still use JobScheduler.

Upvotes: 2

Related Questions