• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

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

AndroiDev

Lurker
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?
 
Back
Top Bottom