1

(Note :i am not asking for code,if you have experience related to his topic,only then comment)

I am populating a very big list using Mediastore(a database) and sorting it by name initially,(using the sort order parameter in the cursor) that is working fine.Now I want to re sort that list depending on what user chooses.

So I am confused what should i use to sort?Should i use comparator ?Or should I use the cursor again ??I want the sorting to be very fast.

Is sorting using cursor faster than Comparator ?

Is Comparator good for very large lists ??

Is sorting using a database faster than any other thing ??

Please tell me what to go for ?

1 Answer 1

2

If you can use a database to do something, then it is best to use the database. This way you will also leverage native code facilities, which will make it all faster. Make another query with different parameters if you can.

Sign up to request clarification or add additional context in comments.

2 Comments

Okay thank you,just to confirm,are you sure that sorting using database is faster than any other thing ?
@AnkitSrivastava To be completely sure, you should do the testing, of course. But it definitely should be that way.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.