I\'m familiar with the ways I can get an element position in array, especially the ones showed here: Element position in array
But my problem is I can\'t figure out
Hope this will help you.change your code like this:
if (listPackages.contains(current_package)){ int position=listPackages.indexOf(current_package); }
Also if you will make position variable as global you can access its value outside this block of code. :)