1. Download our Official Android App: Forums for Android!

onListItemClick()-how to match efficiently result String with various options

Discussion in 'Android Apps & Games' started by AndroiDev, Jul 6, 2010.

  1. AndroiDev

    AndroiDev Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    8
    Joined:
    Jun 9, 2010

    Jun 9, 2010
    8
    0
    5
    When you have a list activity and in onListItemClick() you need to obtain the selected item and then match it against various options, what is the efficient way to do it? switch case cannot be used since I want to match Strings. Is a very long if-else if ladder the only way to do it?
     

    Advertisement

Share This Page

Loading...