- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我尝试运行程序代码 soundclouddroid https://code.google.com/p/soundclouddroid/source/browse/ 1.2.2.在我选择 Stackoverflow 之前,我遇到了另一个问题,但现在我遇到了一个问题,无法理解为什么会这样。我的问题是:
java.lang.RuntimeException: Unable to start activity ComponentInfo {es.manu.sd122.soundCloudDroid/es.manu.sd122.soundCloudDroid.CustomTrackListsActivity}: java.lang.IllegalArgumentException: Unknown URI content :/ / is .manu.sd122.provider.soundCloudDroid/tracklists
该程序尝试提取 Souncloud 数据。在 Souncloud 页面中,我创建了一个应用程序,获得了客户端 ID 和客户端密码,还添加了为身份验证设置的重定向 URI 字段:http://es.manu.sd122.provider.soundCloudDroid .添加 http://Souncloud 网站。
你能帮帮我吗?谢谢
日志:
10-18 09:07:45.839: E/AndroidRuntime(400): FATAL EXCEPTION: main
10-18 09:07:45.839: E/AndroidRuntime(400): java.lang.RuntimeException: Unable to start activity ComponentInfo{es.manu.sd122.soundCloudDroid/es.manu.sd122.soundCloudDroid.CustomTrackListsActivity}: java.lang.IllegalArgumentException: Unknown URI content://es.manu.sd122.provider.soundCloudDroid/tracklists
10-18 09:07:45.839: E/AndroidRuntime(400): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)
10-18 09:07:45.839: E/AndroidRuntime(400): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
10-18 09:07:45.839: E/AndroidRuntime(400): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
10-18 09:07:45.839: E/AndroidRuntime(400): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
10-18 09:07:45.839: E/AndroidRuntime(400): at android.os.Handler.dispatchMessage(Handler.java:99)
10-18 09:07:45.839: E/AndroidRuntime(400): at android.os.Looper.loop(Looper.java:123)
10-18 09:07:45.839: E/AndroidRuntime(400): at android.app.ActivityThread.main(ActivityThread.java:3683)
10-18 09:07:45.839: E/AndroidRuntime(400): at java.lang.reflect.Method.invokeNative(Native Method)
10-18 09:07:45.839: E/AndroidRuntime(400): at java.lang.reflect.Method.invoke(Method.java:507)
10-18 09:07:45.839: E/AndroidRuntime(400): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
10-18 09:07:45.839: E/AndroidRuntime(400): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
10-18 09:07:45.839: E/AndroidRuntime(400): at dalvik.system.NativeStart.main(Native Method)
10-18 09:07:45.839: E/AndroidRuntime(400): Caused by: java.lang.IllegalArgumentException: Unknown URI content://es.manu.sd122.provider.soundCloudDroid/tracklists
10-18 09:07:45.839: E/AndroidRuntime(400): at es.manu.sd122.soundCloudBase.SoundCloudData.query(SoundCloudData.java:244)
10-18 09:07:45.839: E/AndroidRuntime(400): at android.content.ContentProvider$Transport.query(ContentProvider.java:187)
10-18 09:07:45.839: E/AndroidRuntime(400): at android.content.ContentResolver.query(ContentResolver.java:262)
10-18 09:07:45.839: E/AndroidRuntime(400): at es.manu.sd122.soundCloudDroid.CustomTrackListsActivity.onCreate(CustomTrackListsActivity.java:28)
10-18 09:07:45.839: E/AndroidRuntime(400): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
10-18 09:07:45.839: E/AndroidRuntime(400): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
10-18 09:07:45.839: E/AndroidRuntime(400): ... 11 more
list :
<provider android:name="es.manu.sd122.soundCloudBase.SoundCloudData" android:authorities="es.manu.sd122.provider.soundCloudDroid">
</provider>
souncCloudDroid数据库
import android.net.Uri;
import android.provider.BaseColumns;
public class DB extends es.manu.sd122.soundCloudBase.DB
{
protected DB()
{
super();
}
public static final class TrackLists implements BaseColumns
{
// This class cannot be instantiated
private TrackLists() {}
public static final String TABLE_NAME = "tracklists";
/**
* The content:// style URL for this table
*/
public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/tracklists");
/**
* The MIME type of {@link #CONTENT_URI} providing a directory of entries.
*/
public static final String CONTENT_TYPE = "vnd.android.cursor.dir/" + PACKAGE + ".tracklists";
/**
* The MIME type of a {@link #CONTENT_URI} sub-directory of a single entry.
*/
public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/" + PACKAGE + ".tracklists";
public static final String RESOURCE = "resource";
public static final String TITLE = "title";
public static final String DEFAULT_SORT_ORDER = _ID + " ASC";
}
}
soundCloudBase数据库
import android.net.Uri;
import android.provider.BaseColumns;
import es.manu.sd122.soundCloudBase.Config;
public class DB
{
public static final String AUTHORITY = Config.AUTHORITY;
public static final String PACKAGE = Config.PACKAGE;
// This class cannot be instantiated
protected DB() {}
public static final class Uploads implements BaseColumns
{
// This class cannot be instantiated
private Uploads() {}
public static final String TABLE_NAME = "uploads";
/**
* The content:// style URL for this table
*/
public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/uploads");
/**
* The MIME type of {@link #CONTENT_URI} providing a directory of app data entries.
*/
public static final String CONTENT_TYPE = "vnd.android.cursor.dir/" + PACKAGE + ".uploads";
/**
* The MIME type of a {@link #CONTENT_URI} sub-directory of a single app data entry.
*/
public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/" + PACKAGE + ".uploads";
public static final String TITLE = "title";
public static final String PATH = "path";
public static final String STATUS = "status";
public static final String SHARING = "sharing";
public static final String DESCRIPTION = "description";
public static final String GENRE = "genre";
public static final String TRACK_TYPE = "track_type";
public static final String DEFAULT_SORT_ORDER = _ID + " DESC";
}
public static final class Tracks implements BaseColumns
{
// This class cannot be instantiated
private Tracks() {}
public static final String TABLE_NAME = "tracks";
/**
* The content:// style URL for this table
*/
public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/tracks");
/**
* The MIME type of {@link #CONTENT_URI} providing a directory of app data entries.
*/
public static final String CONTENT_TYPE = "vnd.android.cursor.dir/" + PACKAGE + ".tracks";
/**
* The MIME type of a {@link #CONTENT_URI} sub-directory of a single app data entry.
*/
public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/" + PACKAGE + ".tracks";
public static final String TITLE = "title";
public static final String ID = "id";
public static final String STREAM_URL = "stream_url";
public static final String DURATION = "duration";
public static final String CLASS = "class";
public static final String DEFAULT_SORT_ORDER = ID + " DESC";
}
}
配置
public class Config
{
public static final String AUTHORITY = "es.manu.sd122.provider.soundCloudDroid";
public static final String PACKAGE = "es.manu.sd122.soundCloudDroid";
private Config()
{}
}
CustomTrackListsActivity
import es.manu.sd122.soundCloudDroid.DB;
import android.app.ListActivity;
import android.content.Intent;
import android.database.Cursor;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.ListView;
import android.widget.SimpleCursorAdapter;
public class CustomTrackListsActivity extends ListActivity
{
/**
* The method called when the Activity is created.
* <p>
* Initializes the user interface.
*/
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
this.setContentView(R.layout.custom_track_lists);
// Read uploads
mCursor = getContentResolver().query(DB.TrackLists.CONTENT_URI, null, DB.TrackLists.RESOURCE + "<>\"\"", null, null);
SimpleCursorAdapter adapter = new SimpleCursorAdapter(this, R.layout.track_list_item, mCursor,
new String[] { DB.TrackLists.TITLE }, new int[] { android.R.id.text1 });
setListAdapter(adapter);
findViewById(R.id.use_menu).setVisibility(mCursor.getCount()<=2 ? View.VISIBLE : View.INVISIBLE);
}
public void onDestroy()
{
super.onDestroy();
mCursor.close();
}
public boolean onCreateOptionsMenu(Menu menu)
{
super.onCreateOptionsMenu(menu);
mArtistTracksMenuItem = menu.add("Search for Artists").setIcon(android.R.drawable.ic_menu_add);
return true;
}
public boolean onOptionsItemSelected(MenuItem item)
{
if(item == mArtistTracksMenuItem)
{
startActivity(new Intent(getApplication(), NewArtistTracksActivity.class));
return true;
}
else return super.onOptionsItemSelected(item);
}
public void onListItemClick(ListView parent, View v, int position, long id)
{
mCursor.moveToPosition(position);
Intent intent;
if(id == 0)
intent = new Intent(getApplication(), ViewTracksActivity.class);
else
{
intent = new Intent(getApplication(), ViewOtherTracksActivity.class);
intent.putExtra(DB.TrackLists.RESOURCE, mCursor.getString(1));
intent.putExtra(DB.TrackLists.TITLE, mCursor.getString(2));
intent.putExtra(DB.TrackLists._ID, id);
}
startActivity(intent);
}
private MenuItem mArtistTracksMenuItem;
private Cursor mCursor;
}
我一直在查看与 Stackoverflow 上的错误 Unkown Uri Content 相关的各种问题,但我仍然可以移动。
谢谢
最佳答案
我在其他开发者那里看到了同样的问题,但是LogCat
中显示的错误信息有关键
Caused by: java.lang.IllegalArgumentException: Unknown URI content://es.manu.sd122.provider.soundCloudDroid/tracklists
at es.manu.sd122.soundCloudBase.SoundCloudData.query(SoundCloudData.java:244)
未知的 URI:
es.manu.sd122.provider.soundCloudDroid
所以必须改成:
es.manu.sd122.soundCloudBase.SoundCloudData
关于android - java.lang.IllegalArgumentException : Unknown URI content 异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19446927/
这是我的代码 14 20 {"Confirm Email"} 21 在第 17 行我得到错误 Type '{ pathname: string; user: { em
这是我的代码 14 20 {"Confirm Email"} 21 在第 17 行我得到错误 Type '{ pathname: string; user: { em
这个问题已经有答案了: How do I compare strings in Java? (23 个回答) 已关闭 8 年前。 为什么 KeyEvent.getKeyText(0).substrin
我正在尝试 Rust 的新 wasm32-unknown-unknown 目标,我在调用数学函数(例如 sin、cos、exp、atan2)时遇到问题。 cargo .toml: [package]
当我为 spring-boot 创建启动项目时,我在 pom 文件中收到此错误。这只是为了创建一个基本的 Spring Boot 项目 Project build error: Invalid pac
我已经订阅了我想要传输的数据。但不知何故它不起作用。我收到此错误: The property pipe is not available for type "OperatorFunction" 这是我
运行以下查询时。select * from surgerys where to_char(dt_surgery ,'DD-MM-YYYY' ) = to_char('12-02-2012','DD-M
我在运行存储过程时遇到以下异常: com.microsoft.sqlserver.jdbc.SQLServerException:不支持从 UNKNOWN 到 UNKNOWN 的转换。 过程定义如下:
我尝试运行以下代码。顺便说一句,我对 python 和 sklearn 都是新手。 import pandas as pd import numpy as np from sklearn.linear
我已经阅读了关于未知类型的官方文档,但我很难真正理解它是如何工作的。 人们可以在文档中读到:“在没有首先断言或缩小到更具体的类型之前,不允许对未知进行任何操作。” 但如果我有这个功能: const f
我正在尝试在Mac OS中设置Hadoop 2.6.0 我正在关注这篇文章: http://hadoop.apache.org/docs/r2.4.0/hadoop-project-dist/hado
配置 Nexus docker 注册表和代理“dockerhub-proxy”后,如下所述: https://help.sonatype.com/repomanager3/formats/docker
我收到此错误 - “ValueError:未知标签类型:'unknown'” 我已经在网上搜索但无法摆脱这个错误,顺便说一句,我是 python 的新手:) 我的数据有 5 行 22 列,最后一列是标
使用 SHA256 摘要标识符 拉取图像失败 最佳答案 不幸的是,这是 DockerHub 删除 Docker 1.9 守护进程的向后兼容性的副作用。当使用 Docker 1.10 推送图像时,较旧的
我是 postgresql 的新手,正在尝试使用全文搜索 to_tsvector但是我遇到了错误。 SQL 和错误 SELECT to_tsvector('english', 'The quick b
每当我这样做时 npm run watch ,第一次编译工作正常 - 但经过几次编译后,我最终会得到这个错误: 95% emitting unnamed compat pluginError: UNK
在一个新的 Angular 应用程序中,我收到以下错误:Error from chokidar : Error: UNKNOWN: unknown error, watch我已经删除并重新安装 nod
使用 Typescipt 4.x.x 我写了一些代码来实现其他语言 Elm/Rust/Haskell 中常用的 Maybe/Option 类型。 我想写一个可以接受映射类型的通用函数 type MyM
const submitted = useSelector((state) => state.post.submitted) 对于上面的状态。我得到错误: (参数)状态:未知对象的类型为“未知”。 这
我正在尝试将多架构 docker 镜像推送到 docker hub 并遇到错误(在 https://github.com/docker/distribution/issues/3100 处打开了 do
我是一名优秀的程序员,十分优秀!