我正在尝试开发一个可以拍照的应用程序,然后将它们上传到数据库。现在我坚持拍摄高质量的照片。正如我之前读到的,要获得质量更好的照片,您需要将其保存在您的目录中。我正在遵循 开发人员说明中的Google Take Photos,在添加了所有方法和提供程序等之后,我收到错误消息:
Couldn't find meta-data for provider with authority com.example.navigationdrawerfinal.
Run Code Online (Sandbox Code Playgroud)
我已经留下了我的应用程序的名称,以便每个人都可以看到我也在清单中更改了它。
显现:
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="com.example.navigationdrawerfinal.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths" />
</provider>
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="@string/google_maps_key" />
Run Code Online (Sandbox Code Playgroud)
file_paths.xml :
<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<external-path name="my_images" path="Android/data/com.example.navigationdrawerfinal/files/Pictures" />
</paths>
Run Code Online (Sandbox Code Playgroud)
以及我使用它的代码:
private void dispatchTakePictureIntent() {
Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
// Ensure that there's a camera activity to handle the intent
if (takePictureIntent.resolveActivity(getPackageManager()) != null) {
// Create the File where the photo should go
File photoFile = …
Run Code Online (Sandbox Code Playgroud) 我正在尝试将折线添加到当前位置和动态添加到地图的标记之间的地图。它应该工作的方式是,当InfoWindow
按下标记时,会打开一个对话框,询问您是否要前往该点,当按下“是”选项时,它应该将折线添加到该点。
单击信息窗口时:
\n\npublic void onInfoWindowClick(final Marker marker1) {\n final AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setMessage("Dori\xc8\x9bi s\xc4\x83 merge\xc8\x9bi la aceast\xc4\x83 alert\xc4\x83?")\n .setCancelable(true)\n .setPositiveButton("Da", new DialogInterface.OnClickListener() {\n public void onClick(@SuppressWarnings("unused") final DialogInterface dialog, @SuppressWarnings("unused") final int id) {\n ScoateMarkerRute();\n markerSelectat=marker1;\n layout_confirmare.setVisibility(GONE);\n layout_validare.setVisibility(GONE);\n calculateDirections(marker1);\n dialog.dismiss();\n }\n })\n .setNegativeButton("Nu", new DialogInterface.OnClickListener() {\n public void onClick(final DialogInterface dialog, @SuppressWarnings("unused") final int id) {\n dialog.cancel();\n }\n });\n final AlertDialog alert = builder.create();\n alert.show();\n}\n
Run Code Online (Sandbox Code Playgroud)\n\n计算方向();:
\n\nprivate void calculateDirections(Marker marker){\n Log.d(TAG, "calculateDirections: …
Run Code Online (Sandbox Code Playgroud)