English 中文(简体)
在“自有内容提供人”中插入数据。
原标题:Error in insert data in Own Content Provider?
  • 时间:2011-11-21 06:48:43
  •  标签:
  • android

Here i make my own home screen launcher when i make vent of longpress on screen than i got one dialog box of select options like Widget and Shortcuts etc. so when i select Widget than i got another dialog box like inbuilt applications widgets. when i select any widget for load than i have problem I implemented this whole code with reference of Android 2.3 Source code.

这部法典中有自己的内容提供者。 一、使用压倒性方法 http://www.unentResolver>。 因此,在我执行这一方案时,我也提到Below。

Code : Here Notify Value is false.

   Uri result = cr.insert(notify ? LauncherSettings.Favorites.CONTENT_URI :
                LauncherSettings.Favorites.CONTENT_URI_NO_NOTIFICATION, values);

Error

11-21 11:23:50.309: E/ActivityThread(4727): Failed to find provider info for com.test.launcher.settings
11-21 11:23:50.549: D/AndroidRuntime(4727): Shutting down VM
11-21 11:23:50.549: W/dalvikvm(4727): threadid=1: thread exiting with uncaught exception (group=0x40018578)
11-21 11:23:50.589: E/AndroidRuntime(4727): FATAL EXCEPTION: main
11-21 11:23:50.589: E/AndroidRuntime(4727): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=9, result=-1, data=Intent { (has extras) }} to activity {com.test.launcher/com.test.launcher.Launcher}: java.lang.IllegalArgumentException: Unknown URL content://com.test.launcher.settings/favorites?notify=false
11-21 11:23:50.589: E/AndroidRuntime(4727):     at android.app.ActivityThread.deliverResults(ActivityThread.java:2536)
11-21 11:23:50.589: E/AndroidRuntime(4727):     at android.app.ActivityThread.handleSendResult(ActivityThread.java:2578)
11-21 11:23:50.589: E/AndroidRuntime(4727):     at android.app.ActivityThread.access$2000(ActivityThread.java:117)
11-21 11:23:50.589: E/AndroidRuntime(4727):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:965)
11-21 11:23:50.589: E/AndroidRuntime(4727):     at android.os.Handler.dispatchMessage(Handler.java:99)
11-21 11:23:50.589: E/AndroidRuntime(4727):     at android.os.Looper.loop(Looper.java:130)
11-21 11:23:50.589: E/AndroidRuntime(4727):     at android.app.ActivityThread.main(ActivityThread.java:3687)
11-21 11:23:50.589: E/AndroidRuntime(4727):     at java.lang.reflect.Method.invokeNative(Native Method)
11-21 11:23:50.589: E/AndroidRuntime(4727):     at java.lang.reflect.Method.invoke(Method.java:507)
11-21 11:23:50.589: E/AndroidRuntime(4727):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
11-21 11:23:50.589: E/AndroidRuntime(4727):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
11-21 11:23:50.589: E/AndroidRuntime(4727):     at dalvik.system.NativeStart.main(Native Method)
11-21 11:23:50.589: E/AndroidRuntime(4727): Caused by: java.lang.IllegalArgumentException: Unknown URL content://com.test.launcher.settings/favorites?notify=false
11-21 11:23:50.589: E/AndroidRuntime(4727):     at android.content.ContentResolver.insert(ContentResolver.java:600)
11-21 11:23:50.589: E/AndroidRuntime(4727):     at com.test.launcher.Launcher.addItemToDatabase(Launcher.java:420)
11-21 11:23:50.589: E/AndroidRuntime(4727):     at com.test.launcher.Launcher.completeAddAppWidget(Launcher.java:369)
11-21 11:23:50.589: E/AndroidRuntime(4727):     at com.test.launcher.Launcher.onActivityResult(Launcher.java:154)
11-21 11:23:50.589: E/AndroidRuntime(4727):     at com.test.launcher.Launcher.addAppWidget(Launcher.java:308)
11-21 11:23:50.589: E/AndroidRuntime(4727):     at com.test.launcher.Launcher.onActivityResult(Launcher.java:151)
11-21 11:23:50.589: E/AndroidRuntime(4727):     at android.app.Activity.dispatchActivityResult(Activity.java:3908)
11-21 11:23:50.589: E/AndroidRuntime(4727):     at android.app.ActivityThread.deliverResults(ActivityThread.java:2532)
11-21 11:23:50.589: E/AndroidRuntime(4727):     ... 11 more
最佳回答

You need to mention you provider in your manifest file,

Refer provider,
Simple Content Provider for db operations

问题回答

你不妨检查你们的《世界投资倡议》。 i 不能确定是否接受(?)性质。





相关问题
Android - ListView fling gesture triggers context menu

I m relatively new to Android development. I m developing an app with a ListView. I ve followed the info in #1338475 and have my app recognizing the fling gesture, but after the gesture is complete, ...

AsyncTask and error handling on Android

I m converting my code from using Handler to AsyncTask. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread. What s unclear to me is how to handle ...

Android intent filter for a particular file extension?

I want to be able to download a file with a particular extension from the net, and have it passed to my application to deal with it, but I haven t been able to figure out the intent filter. The ...

Android & Web: What is the equivalent style for the web?

I am quite impressed by the workflow I follow when developing Android applications: Define a layout in an xml file and then write all the code in a code-behind style. Is there an equivalent style for ...

TiledLayer equivalent in Android [duplicate]

To draw landscapes, backgrounds with patterns etc, we used TiledLayer in J2ME. Is there an android counterpart for that. Does android provide an option to set such tiled patterns in the layout XML?

Using Repo with Msysgit

When following the Android Open Source Project instructions on installing repo for use with Git, after running the repo init command, I run into this error: /c/Users/Andrew Rabon/bin/repo: line ...

Android "single top" launch mode and onNewIntent method

I read in the Android documentation that by setting my Activity s launchMode property to singleTop OR by adding the FLAG_ACTIVITY_SINGLE_TOP flag to my Intent, that calling startActivity(intent) would ...

From Web Development to Android Development

I have pretty good skills in PHP , Mysql and Javascript for a junior developer. If I wanted to try my hand as Android Development do you think I might find it tough ? Also what new languages would I ...

热门标签