How delete a particular call log from call log list

by Gulfam » Thu, 12 Mar 2009 15:33:36 GMT


Sponsored Links
 Hi,

   I have deleted whole call log by the following statement
context.getContentResolver().delete
(CallLog.Calls.CONTENT_URI,null,null);

but i am facing problem to delete particular call log from call log
list by the following code any one can help me.
 if any one have successfully delete particular call log please change
in my following code i want to delete that numbers form call log that
starts with + or 00 its urgent.

Uri   delUri = Uri.withAppendedPath(CallLog.Calls.CONTENT_URI,"");
Cursor cursor =      context.getContentResolver().query
(delUri,null,null,null,null);

                                                                
context.getContentResolver().delete
(delUri,"_id="+cursor.getCount(),null);

Thanks & Regards,
Gulfam
--~--~---------~--~----~------------~-------~--~----~



How delete a particular call log from call log list

by Eric » Fri, 13 Mar 2009 01:43:04 GMT


 You need to iterate through your Cursor and get the _id values of the
entries you want to delete (the ones who number starts with + or 00).
Then you can delete that individual entries.

// assume the row you want to delete has an _id value of 2
getContentResolver().delete(delUri, "_id=2", null)


What you were doing was incorrect because  you were setting the _id to
cursor.getCount() which doesn't make sense.

  Eric





--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Other Threads

1. Android Maps API + KML file

Hi everyone,

I have some KML files I would like to display in my map. Does anyone
have an example of showing KML files in the android maps API? I know
you can do it in the web api for javascript.

Thanks for the time and help,

Tommy

-- 

2. VerifyError reloaded

Hi,
I'm currently trying to port the famous complex event processing
runtime "Esper" to the Android (2.2) platform and am facing a
VerifyError, which I - although reading several other post on
VerifyErrors - do not understand.

The project I am trying to build and run contains only Java sources
(no libraries). Therefore, I assume, that if these are compiled
successfully, they would pass the verification process. But during
runtime, I get the following error:

09-25 18:33:27.549: WARN/dalvikvm(300): VFY: invalid switch start: at
8, switch offset -31132, count 34530
09-25 18:33:27.549: WARN/dalvikvm(300): VFY:  rejected Lcom/espertech/
esper/epl/generated/EsperEPL2GrammarParser
$DFA156;.specialStateTransition (ILorg/antlr/runtime/IntStream;)I
09-25 18:33:27.549: WARN/dalvikvm(300): Verifier rejected class Lcom/
espertech/esper/epl/generated/EsperEPL2GrammarParser$DFA156;
09-25 18:33:27.559: DEBUG/AndroidRuntime(300): Shutting down VM
09-25 18:33:27.559: WARN/dalvikvm(300): threadid=1: thread exiting
with uncaught exception (group=0x4001d800)
09-25 18:33:27.589: ERROR/AndroidRuntime(300): FATAL EXCEPTION: main
09-25 18:33:27.589: ERROR/AndroidRuntime(300): java.lang.VerifyError:
com.espertech.esper.epl.generated.EsperEPL2GrammarParser$DFA156
09-25 18:33:27.589: ERROR/AndroidRuntime(300):     at
com.espertech.esper.epl.generated.EsperEPL2GrammarParser.<init>(EsperEPL2GrammarParser.java:
28870)
09-25 18:33:27.589: ERROR/AndroidRuntime(300):     at
com.espertech.esper.epl.generated.EsperEPL2GrammarParser.<init>(EsperEPL2GrammarParser.java:
338)
09-25 18:33:27.589: ERROR/AndroidRuntime(300):     at
com.espertech.esper.epl.parse.ParseHelper.parse(ParseHelper.java:108)
09-25 18:33:27.589: ERROR/AndroidRuntime(300):     at
com.espertech.esper.core.EPAdministratorImpl.compileEPL(EPAdministratorImpl.java:
299)
09-25 18:33:27.589: ERROR/AndroidRuntime(300):     at
com.espertech.esper.core.EPAdministratorImpl.createEPLStmt(EPAdministratorImpl.java:
142)
09-25 18:33:27.589: ERROR/AndroidRuntime(300):     at
com.espertech.esper.core.EPAdministratorImpl.createEPL(EPAdministratorImpl.java:
94)
09-25 18:33:27.589: ERROR/AndroidRuntime(300):     at
esper.android.EsperAndroidTest.onCreate(EsperAndroidTest.java:39)
09-25 18:33:27.589: ERROR/AndroidRuntime(300):     at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
1047)
09-25 18:33:27.589: ERROR/AndroidRuntime(300):     at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2627)
09-25 18:33:27.589: ERROR/AndroidRuntime(300):     at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
2679)
09-25 18:33:27.589: ERROR/AndroidRuntime(300):     at
android.app.ActivityThread.access$2300(ActivityThread.java:125)
09-25 18:33:27.589: ERROR/AndroidRuntime(300):     at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
09-25 18:33:27.589: ERROR/AndroidRuntime(300):     at
android.os.Handler.dispatchMessage(Handler.java:99)
09-25 18:33:27.589: ERROR/AndroidRuntime(300):     at
android.os.Looper.loop(Looper.java:123)
09-25 18:33:27.589: ERROR/AndroidRuntime(300):     at
android.app.ActivityThread.main(ActivityThread.java:4627)
09-25 18:33:27.589: ERROR/AndroidRuntime(300):     at
java.lang.reflect.Method.invokeNative(Native Method)
09-25 18:33:27.589: ERROR/AndroidRuntime(300):     at
java.lang.reflect.Method.invoke(Method.java:521)
09-25 18:33:27.589: ERROR/AndroidRuntime(300):     at
com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:868)
09-25 18:33:27.589: ERROR/AndroidRuntime(300):     at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
09-25 18:33:27.589: ERROR/AndroidRuntime(300):     at
dalvik.system.NativeStart.main(Native Method)

The source of "EsperEPL2GrammarParser" is quite big ( > 40,000 lines)
and so is the above mentioned inner class DFA156, which mainly
contains a switch-statement (> 60 cases) and each case contains
several (> 50?) if-then-else statements. Just an idea ... when reading
the error message above (invalid switch start: at 8, switch offset
-31132, count 34530) my alarm bells ring, cause some values around
32768 (16 bit range) always make me nervous.

Nevertheless, I am confused with this VerifyError and would appreciate
any help getting closer to the error's source. What can I do to
encircle the error ?

Thanks in advance,
Cheers Dirk

-- 

3. The Market App has a CACHE !

4. Dictionary File

5. Add child views when scrolling in (extened) AdapterView

6. a good way to do screen cast on android

7. Open one html file from sdcard