简体   繁体   中英

How to add button on each list element in android

Basically, I have an app where you click a button, it brings you to another activity where you type in something and click another button, then brings you back to the first activity and whatever you wrote in the second activity is added to the first activity's arrayList, whose values are shown in a ListView. In that listView I would like to add a button to each row. How to do that?

Here is a tutorial on what you want: Handling Button clicks in a ListView Row

(Remember vague questions receive vague answers because there are many different ways to do you want and we cannot guess which particular method you are using. Always include: what you are trying to do, what you have tried (with relevant code), and why it doesn't work (with the LogCat when applicable) in your question.)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM