android-contentprovider

Can't remove SMS logs from call log on Samsung devices

谁都会走 提交于 2019-12-12 15:41:26
问题 I'm trying to remove all SMS messages from the device via my app, but for some reason SMS logs still appear on the call log on some of the Samsung devices. I've tried a more "radical" approach, and deleted the following URI's using the ContentResolver : content://call_log/calls content://sms content://sms/inbox content://sms/sent content://mms/inbox content://mms content://mms-sms content://mms/address content://mms/part content://mms/sent content://mms/outbox Delete was done with the

Getting a Permission Denial when querying my own ContentProvider from my own App

↘锁芯ラ 提交于 2019-12-12 11:25:40
问题 In one of my apps, I'm using a ContentProvider to save and restore information. This ContentProvider is used by the main application, as well as a couple of services, but all of them are in the same apk, and all the services live in the default (main) process. My content provider is declared like this in my manifest : <provider android:name="sample.provider.SampleProvider" android:authorities="sample.provider" android:exported="false" android:enabled="true"> </provider> One of my classes is

Adding events to native calendar is not working

て烟熏妆下的殇ゞ 提交于 2019-12-12 11:19:16
问题 I am working on an Android application. I have to add events to native Android calendar. So I tried the following code: if (Build.VERSION.SDK_INT >= 8 ) { l_eventUri = Uri.parse("content://com.android.calendar/events"); } else { l_eventUri = Uri.parse("content://calendar/events"); } Cursor cursor = getContentResolver() .query(Uri.parse(getCalendarUriBase(this)),new String[] { "calendar_id", "displayname"}, null,null, null); cursor.moveToFirst(); // fetching calendars name String CNames[] =

Realm with Content Provider

给你一囗甜甜゛ 提交于 2019-12-12 09:09:58
问题 So, I've been used Realm for a while. For now, I have a task to share the login data with my other apps. Since the login data is stored using Realm. I choose to use Content Provider. I found an example: https://speakerdeck.com/androhi/realm-with-contentprovider Unfortunately, I was unable to make it work. This is my Content Provider in app A static final String[] sColumns = new String[]{ "LoginResultData" }; public Cursor query(@NonNull Uri uri, @Nullable String[] projection, @Nullable String

Approach to populate the Expandable List View with local SQlite database

扶醉桌前 提交于 2019-12-12 08:30:18
问题 I have a sqlite database in my application. I want to make an expandable list view with that. I am fixed with the approach I should take for that. Tried a lot to find a tutorial for the same, but could not find a single one, where one is populating the Expandable list with the local database. There is this one tutorial in the android site where they are filling the expandable list with the Contact detail in the phone. They are doing this from the content provider ExpandableList2.java So my

broadcast receiver stops when I click back button

北战南征 提交于 2019-12-12 04:45:44
问题 I am working on an Android sms application.The following code I used to send sms. public void sendSms(final String phoneNumber, final String message){ String SENT = "SMS_SENT"; String DELIVERED = "SMS_DELIVERED"; PendingIntent sentPI = PendingIntent.getBroadcast(this, 0, new Intent(SENT), 0); PendingIntent deliveredPI = PendingIntent.getBroadcast(this, 0, new Intent(DELIVERED),0); //--- When the SMS has been sent -- sendBroadcastReceiver=new BroadcastReceiver() { @Override public void

Is it necessary to implement both LoaderCallbacks and OnLoadCompleteListener to get notifications of changes in a ContentProvider?

人走茶凉 提交于 2019-12-12 03:45:41
问题 I have an application which is using Loader s to get at a database which is also being edited by an IntentService . I receive data from the Loader through a LoaderCallbacks implementation, which is working fine. I am also using ContentResolver#notifyChange(Uri, ContentObserver) to trigger reload. However, this only works when I call Cursor#setNotificationUri(Uri) beforehand. I can find no reference to the latter method in any documentation and it seems in fact this may be causing crashes: see

Sqlite_Content Provider assistant

。_饼干妹妹 提交于 2019-12-12 03:44:47
问题 I am trying to get my ListView to refresh by using a Content Provider. I have created my Provider and have tried to link it propelry to my SqlLite DB. Once I have my provider completed I will implement my cursorloader but 1st I need help with my provider. I have not found and detailed information for novice users on how to create a content provider. any assistance would be appreciated. My DB and Provider are posted below. My main issue is trying to create a URI that links to my DB. DB: public

how to do checkbox in expanablelistview (in groupview and child view)

ぃ、小莉子 提交于 2019-12-12 03:35:28
问题 i am trying to do checkbox in expanablelistview (in groupview and child view). But i am not understanding this concept. so guys if u have any idea please share it with me. This is the first time i am working in this concept(expanablelistview). check box in groupview (CheckBox checkBoxGroup) if i check checkbox in groupview(groupposition 0) all item in child(childposition 0) must get check. same as if i uncheck groupview(groupposition 0)all item in child(childposition 0) must get uncheck.

Android - easy/efficient way to maintain a “cumulative sum” for a SQLite column

ε祈祈猫儿з 提交于 2019-12-12 02:57:08
问题 What is the best way to maintain a "cumulative sum" of a particular data column in SQLite? I have found several examples online, but I am not 100% certain how I might integrate these approaches into my ContentProvider . In previous applications, I have tried to maintain cumulative data myself, updating the data each time I insert new data into the table. For example, in the sample code below, every time I would add a new record with a value score , I would then manually update the value of