String sel="SELECT "+stdb.sid+"," +stdb.amt+", "+stdb.details+" FROM "+stdb.tname;
Cursor c=dobj.rawQuery(sel, null);
while(c.moveToNext()){
int id=c.getInt(c.getColumnIndex(stdb.sid));
int amt=c.getInt(c.getColumnIndex(stdb.amt));
String printdetail=c.getString(c.getColumnIndex(stdb.details));
TextView tv1=(TextView)findViewById(R.id.textView1);
Log.e("gg",""+amt ); //the value of amt comes in logcat
tv1.setText(""+amt);//this gives nullpointer exception
在这里,我试图从edittext中获取一个值,我可以在logcat中看到该值,但是当我尝试使用settext(TextView)打印相同的值时,我得到一个NULLPOINTEREXCEPTION