android - How to Sort ArrayList according to another list -
i making cab booking application..in sending push notification on driver side...i want send pushnotification driver have done minimum jobs..... have 2 lists...one getting jobs column database , second getting objectids database objectids in string , jobs in integers....
i have sorted list of jobs(integers) in ascending order using collections.sort(jobs);
but want objectids list sorted according jobs list...
for example:
this jobs list before sorting:
[11 , 23 , 1 , 5 , 8]
this objectids list :
[rx3sh3bwo4 , p9m1hnwo7l , 71k6akjoo3 , yjlhp0zkkg , 5uffhyiwlk]
when sort jobs list
[1,5,8,11,23]
but want object ids related 1 in 0 index of objectids list...
how sort list objectids comparing jobs list????
use hashmap , add key objectid , values jobid ( or vice versa per requirements)
and if want sorting can use arraylist
Comments
Post a Comment