I assume that I have activity A, activity B, and activity C. in activity A there is a listview that displays the name of activity B and C. how do I display the tick icon on the listview in activity A when I finish opening activity B or activity C like the example image below.
Add an ImageView to the right side of your ListView item layout and set it to be visible just after calling startActivity(). Or, if this is making the checkmarks visible too soon, you can use startActivityForResult(), which will allow you to set the ImageView's visibility only upon returning to Activity A. If your ListView isn't using custom item layouts, you'll need to learn how to do that.
发布评论
评论(1)
将
imageView
添加到ListView
项目布局的右侧,并在调用startActivity()
之后将其设置为可见。或者,如果这使得值得太早可见,则可以使用startActivityForresult()
,它将允许您仅在返回到imageView 的可见性。 >活动 A.如果您的
listView
不使用自定义项目布局,则需要学习如何做。Add an
ImageView
to the right side of yourListView
item layout and set it to be visible just after callingstartActivity()
. Or, if this is making the checkmarks visible too soon, you can usestartActivityForResult()
, which will allow you to set theImageView
's visibility only upon returning toActivity
A. If yourListView
isn't using custom item layouts, you'll need to learn how to do that.