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が取得されます。