locked
What's wrong with SystemState(SystemProperty.PhoneMissedCalls) RRS feed

  • Question

  • Hi all ....

    I'm trying to to figure out how to add the missed call nubmers into my listview in windows
    mobile .

    Code :

     

     

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    
    MonitorNotifications()
    
    End Sub
    
    
    
    Private Sub MonitorNotifications()
    
    _callInterceptor = New SystemState(SystemProperty.PhoneMissedCall)
    
    AddHandler _callInterceptor.Changed, AddressOf CallInterceptor_MissedCalls
    
    End Sub
    
    
    
    Private Sub CallInterceptor_MissedCalls(ByVal sender As Object, ByVal args As ChangeEventArgs)
    
    Dim objMissed As Object = args.NewValue
    
    Dim bMissed As Boolean = (CType(objMissed, Integer) = 0)
    
    If (bMissed = False) Then
    
    Return
    
    End If
    
    Dim item As ListViewItem = New ListViewItem((New String() {SystemState.PhoneLastIncomingCallerName, SystemState.PhoneLastIncomingCallerNumber, DateTime.Now.ToShortTimeString}))
    
    LvMsdLog.Items.Add(item)
    
    
    End Sub
    

    The first time I make a call from the Emulator everything goes well.

    The next times I try , the program doesn't add the missed calls until I dismiss
    the missed calls using the Windows Mobile itself.

    Then I'm able again to add the Missed Call into the ListView .... Then I have
    to Dismiss .... Then I'm able to add ....Then I have to dismiss.

    What can I do ... Plz help.


    Interisted in windows system upgrade
    Saturday, March 13, 2010 3:46 PM

Answers

  • I figured out the mistake I made , I suppose to change

    PhoneMissedCall   ------> PhoneMissedCalls

    so my program will read any changes in Calls Log , Whether the user Dismissed the Missed Calls
    or there is new Missed Calls

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    MonitorNotifications()

    End Sub



    Private Sub MonitorNotifications()

    _callInterceptor = New SystemState(SystemProperty.PhoneMissedCalls)

    AddHandler _callInterceptor.Changed, AddressOf CallInterceptor_MissedCalls

    End Sub

    I hope that may help anyone else.

    Interisted in windows system upgrade
    Monday, March 15, 2010 10:35 AM