我在Android 7上遇到的问题是不支持广播事件"android.hardware.action.NEW_PICTURE"更长.我现在为Android 7写了一个JobService,但是当内部摄像头拍摄图片时它不会触发.我不知道是什么问题,大家可以帮助我.
如果www中的任何示例源代码为Android 7和JobService替换广播 "android.hardware.action.NEW_PICTURE".
感谢帮助 !
这是我的示例代码:
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
public class ZNJobService extends JobService {
private static Zlog log = new Zlog(ZNJobService.class.getName());
static final Uri MEDIA_URI = Uri.parse("content://" + MediaStore.AUTHORITY + "/");
static final int ZNJOBSERVICE_JOB_ID = 777;
static JobInfo JOB_INFO;
@RequiresApi(api = Build.VERSION_CODES.N)
public static boolean isRegistered(Context pContext){
JobScheduler js = pContext.getSystemService(JobScheduler.class);
List<JobInfo> jobs = js.getAllPendingJobs();
if (jobs == null) {
log.INFO("ZNJobService not registered ");
return false;
}
for (int i = 0; i < …Run Code Online (Sandbox Code Playgroud)