- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
这是我遇到的错误:
Caused by: java.lang.IllegalArgumentException: Unknown URL content://com.new.newapp.locations/locations
at android.content.ContentResolver.insert(ContentResolver.java:1213)
at com.new.newapp.activity.FragmentGoogleMap$LocationInsertTask.doInBackground(FragmentGoogleMap.java:364)
at com.new.newapp.activity.FragmentGoogleMap$LocationInsertTask.doInBackground(FragmentGoogleMap.java:360)
我研究了这个问题并发现了这些类似的问题: Link1 Link2 Link3
这些都没有帮助。最让我困扰的是,当我使用 eclipse 时,我没有遇到这个问题,但自从在 Android Studio 上工作后,我似乎无法让它工作。
在我的 LocationsContentProvider
类中:
package com.new.newapp.activity;
public class LocationsContentProvider extends ContentProvider{
public static final String PROVIDER_NAME ="com.new.newapp.activtiy.locations";
public static final Uri CONTENT_URI = Uri.parse("content://" + PROVIDER_NAME + "/locations" );
private static final int LOCATIONS = 1;
private static final UriMatcher uriMatcher ;
static {
uriMatcher = new UriMatcher(UriMatcher.NO_MATCH);
uriMatcher.addURI(PROVIDER_NAME, "locations", LOCATIONS);
}
LocationsDB mLocationsDB;
在我的 list 中我有这个:
</activity>
<provider
android:name="com.new.newapp.activity.LocationsContentProvider"
android:authorities="locations"
android:exported="false" />
</application>
我试过 android:authorities="com.new.newapp.activity.locations"
我也试过 android:name=".LocationsContentProvider"
也搬家了
有人可以帮忙吗?
最佳答案
您的问题在于提供商名称。
<provider
android:name="com.new.newapp.activity.LocationsContentProvider"
android:authorities="locations"
android:exported="false" />
public static final String PROVIDER_NAME ="com.new.newapp.activtiy.locations";
应该是
public static final String PROVIDER_NAME ="com.new.newapp.activity.LocationsContentProvider";
关于android - 如何在android studio中修复 "Unknown URL content://com.new.newapp.locations/locations",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32023122/
我正在尝试使用命令创建一个新的 Angular 应用程序 ng new app-name ..但是运行命令后,它在命令行中显示以下内容。 Installing packages (npm)...npm
Microsoft Windows [版本 10.0.18362.720](c) 2019 微软公司。保留所有权利。 C:\Users\Sriharan>npx create-react-app ne
这是我遇到的错误: Caused by: java.lang.IllegalArgumentException: Unknown URL content://com.new.newapp.locat
我是一名优秀的程序员,十分优秀!