DavidPizarro / AutoLabelUI

Android library to place labels next to another. If there is not enough space for the next label, it will be added in a new line.
Apache License 2.0
636 stars 107 forks source link

Problem position when detete a tag #6

Closed phantuanphong closed 9 years ago

phantuanphong commented 9 years ago

onRemoveLabel(View view, int position). position value allway is -1 when i delete a tag. Something went wrong here?

DavidPizarro commented 9 years ago

Are you using a List like RecyclerView for example? Maybe you aren't using a List and you are using the method 'removeLabel(int position)'.

Remember that methods 'addLabel(String textLabel, int position)' and 'removeLabel(int position)' must be used ONLY with Lists (RecyclerView for example). The position is the place in the list, not the position of the label added.

So, you have to use the method 'removeLabel(String labelToRemove)'. Try this and tell me please!