1. Check out our companion app, Forums for Android! Download from Google Play

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

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

  1. AndroiDev

    AndroiDev Member
    Thread Starter
    5

    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...