First of all where is the user-list source coming from? If the source coming from your own server you could easily sending the userID
to the server to tell your database to not query specific userID
. This approach is very good in the case if you using LIMIT
, if your user try to tag all the people with starting name John then if your record return only 15 record once your user will not getting any data.
Second method will be just using a ArrayList<>
to store the user which you already click. Then you could check something like this
if(!arrayList.contains("key")){
result.add("key");
}
Which arrayList
is where you store your value of user. If it doesn't contain in that arrayList
mean it doesn't selected by the user just go ahead add it into your array. It is just suggestion you need to think how to integrate to your app.
Here is the thing you could mention repeatly with same user in instagram or facebook. If it doesn't contain in the drop down list your user still can typing in the same character to mention that user again so if you worry about notification or something it is better to check for that as well. social application is very hard took me year to built a good one.