Have you ever move cursor to next?
Since the orginal cursor is reference to -1, so if you get the data
directly before moving one step next, it will always give this error.

I found there is
getLastOutgoingCall<https://developer.android.com/reference/android/provider/CallLog.Calls.html#getLastOutgoingCall(android.content.Context)>.
I think you can use this method to get the last call number. And use this
number to query duration .

On Wed, Feb 15, 2012 at 2:22 PM, Jagruti Sangani <
jagruti.sang...@inextrix.com> wrote:

> Hello,
> I want to get the total call duration.I am using the posted code but
> in that I am getting something error like cursor index -1 requested
> with total records 10.How can i  get the call duration of last
> call.Basically i want the timer system like when call will start then
> timer will start and when call end then timer will stop.But that is
> not occur with me so i am trying to get total call duration.If anybody
> know then plz reply me.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to