我决定将Firebase Crash API 9.0.1包含在我的Android应用中.目前一切正常.现在,我想让我的用户有机会禁用,Firebase会自动发送崩溃报告.
可以使用此代码段禁用Firebase Analytics
FirebaseAnalytics.getInstance(this).setAnalyticsCollectionEnabled(false);
Run Code Online (Sandbox Code Playgroud)
你们中有谁知道类似的方法来禁用崩溃报告吗?
非常感谢
我创建了一个应用程序,用于创建 gpx 文件。除了共享之外,一切正常。因此我创建了一个文件提供程序。您可以在下面看到它的配置。Provider 在我运行 Android 8.0.0 的 android 设备上运行良好,但在朋友 Huawei (6.0) 上它不工作
Fatal Exception: java.lang.IllegalArgumentException
Failed to find configured root that contains /storage/8737-15E4/Android/data/XXX/cache/20171009_171900.gpx
Run Code Online (Sandbox Code Playgroud)
清单中的提供者:
<provider
android:name=".GenericFileProvider"
android:authorities="com.package.test.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths" />
</provider>
Run Code Online (Sandbox Code Playgroud)
文件路径.xml:
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<external-files-path name="external-files" path="/" />
<external-cache-path name="cache-files" path="/" />
</paths>
Run Code Online (Sandbox Code Playgroud)
代码中的用法:
File gpxFile = new File(context.getExternalCacheDir(), "20171009_171900.gpx");
Uri gpxContentUri = FileProvider.getUriForFile(context, context.getPackageName() + ".fileprovider", gpxFile);
Intent gpxIntent = new Intent(Intent.ACTION_SEND);
gpxIntent.setType("text/gpx");
gpxIntent.putExtra(Intent.EXTRA_STREAM, gpxContentUri);
Intent programChooser = Intent.createChooser(gpxIntent, context.getString(R.string.select_app_to_share));
programChooser.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
activityForDialog.startActivity(programChooser);
Run Code Online (Sandbox Code Playgroud)
我希望有人能帮我找到导致应用程序在某些设备上崩溃的错误...
我正在为 iOS 构建一个应用程序,它允许用户基于位置存储图像。现在我想使用 iOS 中最新的AnnotationView( MKMarkerAnnotationView) 来实现此目的,因为它提供了自动集群。
我的问题是,这个类需要 aglyphTintColor如果没有提供它设置为UIColor().red. iOS 使用这种颜色来为整个图像着色。之后图像就只有这种颜色。我尝试将其设置glyphTintColor为,nil但这会导致图像变红。我也尝试将其设置为,UIColor(red:1.00, green:1.00, blue:1.00, alpha:0.0)但之后图像消失了,您只能看到标记本身。
我希望标记以原始颜色而不是单色显示图像。
谁能帮我解决这个问题吗?
这是我的完整代码:
func mapView(_ mapView: MKMapView, viewFor annotation: MKAnnotation) -> MKAnnotationView? {
if annotation is MKUserLocation {
return nil
}
let identifier = "PinAnnotationIdentifier"
var pinView = MKMarkerAnnotationView(annotation: annotation, reuseIdentifier: identifier)
pinView?.annotation = annotation
pinView?.clusteringIdentifier = "clusterId"
pinView?.rightCalloutAccessoryView = UIButton(type: .detailDisclosure)
pinView?.canShowCallout = false
pinView?.glyphImage = UIImage(named: "image")
return pinView
}
Run Code Online (Sandbox Code Playgroud) 我在我的Android应用程序中使用OSMDroid.一切正常,但我无法显示图标以显示我当前的位置.遵循我的准则:
openMapView = (org.osmdroid.views.MapView) v.findViewById(R.id.openmapview);
openMapView.setClickable(true);
openMapView.setMultiTouchControls(true);
final float scale = getResources().getDisplayMetrics().density;
final int newScale = (int) (256 * scale);
String[] OSMSource = new String[2];
OSMSource[0] = "http://a.tile.openstreetmap.org/";
OSMSource[1] = "http://b.tile.openstreetmap.org/";
XYTileSource MapSource = new XYTileSource(
"OSM",
null,
1,
18,
newScale,
".png",
OSMSource
);
openMapView.setTileSource(MapSource);
mapController = (MapController) openMapView.getController();
mapController.setZoom(14);
// My Location Overlay
myLocationoverlay = new MyLocationOverlay(getActivity(), openMapView);
myLocationoverlay.enableMyLocation(); // not on by default
myLocationoverlay.enableCompass();
myLocationoverlay.disableFollowLocation();
myLocationoverlay.setDrawAccuracyEnabled(true);
myLocationoverlay.runOnFirstFix(new Runnable() {
public void run() {
mapController.animateTo(myLocationoverlay.getMyLocation());
}
});
Run Code Online (Sandbox Code Playgroud)
任何人都可以给我一个想法,我要去哪里以及我的代码应该改变什么.
android ×3
docker ×1
encryption ×1
firebase ×1
icons ×1
ios ×1
mapkit ×1
mkmapview ×1
osmdroid ×1
postgresql ×1