android - Deleting items from list view bug -
so have problem listview when delete data database. problem other items in list view mest have noted when delete second bottom problem occurs
database
//getrowrevers public cursor getallrowre(){ string where=null; string orderby = id_key + " desc"; cursor cursor=db.query(true, database_table, all_key, where, null, null, null,id_key + " desc", null); if(cursor!=null){ cursor.movetofirst(); } return cursor; } //delete public boolean deleatrow(string idrow){ string where=id_key+"="+idrow; return db.delete(database_table, where, null) != 0; } public void deleatall(){ cursor cursor=getallrowre(); long idrow=cursor.getcolumnindexorthrow(id_key); if(cursor.movetofirst()){ do{ deleatrow(cursor.getstring((int) idrow)); }while(cursor.movetonext()); } }
so here how managed list view working think method not best , maybe reason , don't know how in different way
@override public void onitemclick(adapterview<?> parent, view view, int position, long id) { // todo auto-generated method stub int mysuperint=dbj.countcases()+ 1 -position-2; intent myintent = new intent(getactivity(), jornallistviewclick.class); myintent.putextra("intvariablename",mysuperint); startactivity(myintent); } });
ps list view changing when user pass data
Comments
Post a Comment