I created an autocompleteTextView that shows the results that I got from a client depanding of the query the user entered.
The results from the client arent ordered in any way.
For example, if the users typed harry pot I could get:
harry and the tree
the trees and harry
harry pot right
ben and harry
harry and be
and so on.
I would like that the results will appear by relevance = if the user typed in harry pot I want to assume that it starts with harry pot.
harry pot right
harry and be
harry and the tree
the trees and harry
ben and harry
How could I sort my ArrayList to show first the results start with this query?
I tried to use stream or comperator but both require API >= 24.
Any way to do it for lower API? (specifically needs API = 21).
Thank you