Filtering algorithm for drop-down activity list, implementation in Android