I have an ArrayList<String>
of length 4 like below -
{"ABC","DEF","GHI","JKL"}
In above ArrayList
the index
of data ABC
is 0
, the index of data DEF
is 1
and so on. Now, there is need that suppose we change the index
of data ABC
from 0
to 2
in that condition my ArrayList
look like below
{"DEF","GHI","ABC","JKL"}
again I change in above the ArrayList
the index
of data GHI
from 1
to 4
my array look like below
{"DEF","ABC","JKL","GHI"}
In above discussion, I wanted to know that when I changed the index of a single data how can we get index of another data. I hope you will be understand my question.
I have a ListView
in android that have drag and drop row. When drag and drop a row from position 0 to 3, then the position of another row will be change. How can we retrieve another row position.