سلام
دوستان ببخشید میدانم باید توی تالار آندروید بپرسم اما اونجا کسی پاسخگو نیست
من تو برنامه برا خوندن داده از بانک این کدها رو نوشتم اما در اجرا هیچی نشون نمیده هیچ خطایی هم ندارم کسی کد بهتری داره یا ایا این کد مشکلی داره
پیشاپیش تشکر
Cursor c1=myDB.getRecord(id);
int count= c1.getCount();
c1.moveToFirst();
if(count == 0)
{
txt.setText(" وجود ندارد");
Toast.makeText(MainActivity.this, "لطفا وارد کنید", Toast.LENGTH_SHORT).show();
}
else
{
for (Integer j = 0; j < count; j1++)
{
txt.setText("");
txt.setText(c1.getString(1));
Toast.makeText(MainActivity.this, "انجام شد", Toast.LENGTH_SHORT).show();
}
}
//تابع
public Cursor getRecord(long rowId) throws SQLException
{
Cursor mCursor = db.query(true, "nam", new String[] { id, nam},
id + "=" + rowId, null, null, null, null, null);
if (mCursor != null) {
mCursor.moveToFirst();
}
return mCursor;
}