none
Canceling a NavigableListActivity RRS feed

  • Question

  •  

    Hello,

     

    I'm trying to use a NavigableListActivity as follows:  If the user is silent, I move to the next item in the list and announce it.  If they are silent on the last item, I want to exit out of the list.   It is working fine, except I can't seem to cancel the Activity in code.  It loops back to the first item in the list.  It never cancels.

     

    I need to use the code in this manner.  I am replacing legacy functionality and the users are accustomed to it.

     

    Any suggestions?

     

    if (e.HistoryItem != null)

    {

    if (e.HistoryItem.GetType().ToString() == "Microsoft.SpeechServer.Dialog.SilenceHistoryItem")

    {

    if (navigableListActivity1.CurrentItem == navigableListActivity1.Items.Count - 1)

    {

    navigableListActivity1.Exit();

    return;

    }

    else

    {

    navigableListActivity1.Next();

    }

    }

    }

    Friday, January 4, 2008 5:38 PM

All replies

  • Where exactly is the code above?

     

    You might have it in a function that gets executed when you call NavigableList.Exit() and since the if case will be false, it will move to the next item which in this case would be the 1st one resulting in the behaviour you're describing.
    Friday, January 4, 2008 11:22 PM
  • It's in the navigableListActivity1_TurnStarting event handler. 

     

    Basically, I'm trying to exit the NavigableList after the no speech timeout on the last item.

     

     

     

     

    Saturday, January 5, 2008 12:36 AM
  • I think TurnStarting is too late to "cancel" the activity.

     

    You might want to try in the SpeechRecognition Complete handler.

     

    Saturday, January 5, 2008 2:42 AM