Use this:
String selectedFromList = (String) (lv.getItemAtPosition(position));
Whatever the datatype you are having in your list, cast accordingly.
Hope it will help. 🙂
More Related Contents:
- how to design form like google calender event in android? [closed]
- RecyclerView inside ScrollView is not working
- What is the difference between match_parent and fill_parent?
- Can not find a View with findViewById()
- How to customize a Spinner in Android
- What is android:weightSum in android, and how does it work?
- Android Studio does not show layout preview
- adjustPan not preventing keyboard from covering EditText
- What’s “tools:context” in Android layout files?
- How can I globally force screen orientation in Android?
- FragmentContainerView using findNavController
- Dynamic form with repeating form
- What is the purpose of Android’s tag in XML layouts?
- Spinner does not wrap text — is this an Android bug?
- How to Automatically add thousand separators as number is input in EditText
- How to wrap the height of a ViewPager to the height of its current Fragment?
- How To Show and hide ActionBar with AppCompat v.7
- android activity has leaked window com.android.internal.policy.impl.phonewindow$decorview Issue
- How can I change font size in PreferenceScreen
- Page scroll when soft keyboard popped up
- How to remove focus without setting focus to another control?
- Find view by name
- android: How can I implement first time tutorial like Go Launcher in my app?
- Change border color when edittext is focused
- Badge on BottomNavigationView
- Android Layout editor ConstraintLayout
- What is the difference between getWidth/Height() and getMeasuredWidth/Height() in Android SDK?
- How to place an imageview on top of another imageview in android
- How to get the graphical layout Window back in Eclipse for Android Application Design?
- How to make bottom navigation show menu items with icon and text except center item menu show only icon? [closed]