android-contentprovider

CursorLoader not updating after data change

自作多情 提交于 2019-12-17 06:29:07
问题 I have created a small application, trying to understand the functionality of the LoaderManager and CursorLoader -classes. I have implemented LoaderCallbacks<Cursor> on my FragmentActivity -class and everything works fine, except the fact that when I update my data via ContentResolver.update() or ContentResolver.insert() -methods, onLoadFinished() is not called and as a result my data doesn't update. I have a custom ContentProvider and I am wondering if the problem is in my ContentProvider

Insertion of thousands of contact entries using applyBatch is slow

旧时模样 提交于 2019-12-17 06:27:31
问题 I'm developing an application where I need to insert lots of Contact entries. At the current time approx 600 contacts with a total of 6000 phone numbers. The biggest contact has 1800 phone numbers. Status as of today is that I have created a custom Account to hold the Contacts, so the user can select to see the contact in the Contacts view. But the insertion of the contacts is painfully slow. I insert the contacts using ContentResolver.applyBatch. I've tried with different sizes of the

Why does ContentResolver.requestSync not trigger a sync?

青春壹個敷衍的年華 提交于 2019-12-17 02:01:16
问题 I am trying to implement the Content-Provider-Sync Adapter pattern as discussed at Google IO - slide 26. My content provider is working, and my sync works when I trigger it from the Dev Tools Sync Tester application, however when I call ContentResolver.requestSync(account, authority, bundle) from my ContentProvider, my sync is never triggered. ContentResolver.requestSync( account, AUTHORITY, new Bundle()); Edit -- added manifest snippet My manifest xml contains: <service android:name=".sync

Creating & using ContentProvider for android

拟墨画扇 提交于 2019-12-14 03:53:01
问题 When I call an Android ContentProvider I get the following exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{de.harm.android.couchone/de.harm.android.couchone.CouchContactClient}: java.lang.IllegalArgumentException: Unknown URL content://de.harm.android.couchone.provider/test2 These are the projects: https://github.com/der-harm/CouchOneProvider .../CouchOneContacts Android uses the so-called ContentResolver to communicate with ContentProvider which in turn handles

Android: Spinner does not update after change of dataset

感情迁移 提交于 2019-12-14 02:24:44
问题 In my app the spinne shows the active items (I use Loader of support library to load them). The init of spinner works fine and it shows only the active items. But I got the followeing problem: When I edit the items in another activity and store them (active and deactivat some of them) an go back (Back-Button), then I see the "old" list of items in the spinner. The adapter get the new cursor with correct data, but the spinner does not refresh his list. What can I do to refresh the spinner list

Where does Content Provider store data?

て烟熏妆下的殇ゞ 提交于 2019-12-14 02:23:58
问题 Why Content Provider is not considered as Data storage option in android Data Storage Options in Android and where do content providers store their data ? 回答1: They are considered different to the other because they provide a way to globally share data between applications. The other data storage options are private to that application. As for where they store their data: From the docs: "How a content provider actually stores its data under the covers is up to its designer." 来源: https:/

Android unit testing with ContentProviders

廉价感情. 提交于 2019-12-14 01:11:34
问题 I have been struggling with a unit testing problem on Android for a while now. My app uses a Sqlite DB to store details on vehicles. I have recently added the ContentProvider pattern to retrieve the data (the database used to be accessed directly). The app works fine, but my tests sporadically fail when run in 'run' mode on eclipse - they pass in 'debug' mode. In my setUp() method, I create a RenamingDelegatingContext in order to create a test version of my database. All this does is prefix

Using content provider to fetch emails

ぐ巨炮叔叔 提交于 2019-12-13 18:31:55
问题 I need to fetch and list the received emails in my own layout listview. Is this possible through Content Provider? 回答1: There are no documented and supported content providers for "received emails". "Email" is not really a part of the operating system (though there are a few lingering references to it from back in the 2006-2007 timeframe when there was no clear distinction between the OS, apps, and the SDK). There are probably hundreds of email clients, only a few of which might have such

What is the format for an android intent?

人走茶凉 提交于 2019-12-13 17:14:51
问题 I'd like to know what is the format for an android intent. IE, what should I pass to the method : getBaseContext().startService(Intent); If I want to pass this: android.provider.CallLog.Calls.CONTENT_URI can i? What would be the format. Can someone give a good explanation of how to use Intents, and how to use it on Service implementation, like, startService() , or onStartCommand (Intent intent, int flags, int startId) . Thanks! 回答1: Just to call a new Activity this is the method.

Can android wear access a content provider from the mobile device?

痴心易碎 提交于 2019-12-13 08:59:04
问题 Since android wear and mobile are two separate devices, is the wear device able to access a public content provider from a custom app that's on the mobile once it is connected? Thanks. edit: if you downvote, pls comment why, as your downvotes don't help me understand anything. edit2: Ok, let me explain a little more. I'm creating a watch face that displays some useful data along with the time and to do that I need to access a content provider from my watch face. Can I access a content