由于android Q的升级 去掉了
/**
* The latitude where the image was captured.
*
* @deprecated location details are no longer indexed for privacy
* reasons, and this value is now always {@code null}.
* You can still manually obtain location metadata using
* {@link ExifInterface#getLatLong(float[])}.
*/
@Deprecated
@Column(value = Cursor.FIELD_TYPE_FLOAT, readOnly = true)
public static final String LATITUDE = "latitude";
/**
* The longitude where the image was captured.
*
* @deprecated location details are no longer indexed for privacy
* reasons, and this value is now always {@code null}.
* You can still manually obtain location metadata using
* {@link ExifInterface#getLatLong(float[])}.
*/
然后 就只能这样操作了
IRecorder.RecorderSpec recorderSpec = new IRecorder.RecorderSpec();
'''
Location location =new Location("");
location.setLatitude(设置维度);
location.setLongitude(设置经度);
recorderSpace.location = location;
Android Q 隐私政策下位置信息处理
本文探讨了Android Q更新后对位置信息处理的影响,详细介绍了由于隐私政策变化,位置详情不再被索引,导致latitude和longitude字段默认为null的问题。并提供了通过ExifInterface手动获取位置元数据的方法,以及使用Location类设置经纬度的替代方案。
3649





