CursorAdapterを拡張するクラスを作成しましたが、bindViewメソッドで問題が発生しています。
@Override
public void bindView(View v, Context context, Cursor c) {
int colNum = c.getColumnIndex(VidCallDbAdapter.QRLINK);
String colValue = c.getString(colNum);
System.out.println("value>> " + colValue);
TextView name_text = (TextView) v.findViewById(R.id.qr_url);
name_text.setText(colValue);
}
この行で常にNullPointerExceptionが発生します
TextView name_text =(TextView)v.findViewById(R.id.qr_url);
xmlの1つでqr_urlを定義したので、奇妙です。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/RelativeLayout01"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView android:layout_height="wrap_content"
android:text=""
android:id="@+id/qr_url"
android:gravity="center_vertical"
android:layout_width="fill_parent"
android:textColor="#000000"
android:textSize="12sp">
</TextView>
</LinearLayout>
コードで何かを見逃しましたか?それがNullPointerExceptionである理由ですか?前もって感謝します。