我正在使用ListView来显示记录。用户可以刷新ListView以在ListView上添加更多记录.I需要在刷新ListView之前将光标显示到ListView的最后一条记录。
ListView正在动态刷新,但它显示的是最上面的记录。我希望在刷新后将其显示在第一条记录上。
我已经尝试实现了这个逻辑,
if(histroyRefreshed){
int index = getListView().getFirstVisiblePosition();
View v = getListView().getChildAt(0);
是否有更新/刷新我的ListView或ListView项目的方法?当前更新/刷新我的ListView的唯一方法是:
public void NewsList_Selected(Object sender, SelectedItemChangedEventArgs e)
{
var a = e.SelectedItem as NewsEntry;
var b = from c in newsEntries
where (a == c)
select c;
foreach(NewsEntry d in b)
{
我正在尝试从ListView中删除项目。但是,在调用notifyDataSetChanged()之后,我的ListView不会刷新,而是在单击EditText之后刷新。我也尝试过使用adapter.remove方法,但这也产生了同样的错误。为什么会发生这种情况?
代码:
public class AddWordActivity extends Activity {
private static ArrayList<String> words = new ArrayList<String>();
@Override
protected void onCreate(Bun
我有一个具有不同布局的行的ListView。所以我使用的是ViewHolder模式。
如果用户单击行,则必须显示/隐藏同一行的一个子布局。
viewHolder.btn1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
int position = (int) v.getTag();
Log.d(TAG, "Line in posit
您好,我想及时刷新列表视图,这里我不会添加/删除任何行。我想刷新,因为要刷新行中的现有数据。
我正在做这件事,但这对我不起作用。
// Update the Message on the screen to help for troubleshooting.
private void updateListView() {
// Callback to update the message in a second.
new CountDownTimer(30000, 1000) {
@Override
public void onTick(lon