【问题标题】:Pb when update / Listview, SQLite and click on a list elementpb 更新/Listview、SQLite 并单击列表元素时
【发布时间】:2014-01-15 14:22:53
【问题描述】:

我的列表视图有一个奇怪的行为。

我的配置:

我的问题: 当我单击一个元素时,按返回返回列表视图并重复此操作 5/6 次,我的视图 2 中有一个奇怪的结果。 有时视图没有填充数据...... 来自数据库的数据……

这是什么? 影响点击元素的 DB 和 Listview 的更新?

谢谢你帮助我

【问题讨论】:

  • 你能提供一些代码吗?问题可能是您如何将数据传递给 View2 或 View2 如何控制内容...

标签: android sqlite listview android-listview android-sqlite


【解决方案1】:

感谢您的回答

一些代码,如果有帮助的话:

// View1 to View2
Intent i1 =new Intent(this, View2.class);
i1.putExtra("IdExtraDB", XX);
this.startActivity(i1);


// View2
oncreate
this.IdExtraDB= Long.valueOf(this.getIntent().getExtras().get("IdExtraDB").toString());
if (this.IdExtraDB!= -1) {
    this.details = GetDetailsInDB();
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-10-21
    • 2016-12-09
    相关资源
    最近更新 更多