私はカスタムTextViewを使用しています。しかし、私がIdでビューを見つけることを使用してそれを取得するとき、私はClassCastExceptionを取得します。カスタムビューを使用中にfindViewByIdでClassCastExceptionが発生する
<View class="com.android.smsapp.MsgTextView" android:id="@+id/text"
そして、このようなjavaファイルでそれを使用した:私はこのようなXMLファイルでそれを使用しています。
MsgTextView text = (MsgTextView) row.findViewById(R.id.text);
私が間違って何をしているのですか?
@Pavandroid
私は私が適切にチェックすると、LogCatではなく、上記の1行
03-19 14:30:41.476: E/AndroidRuntime(24089): Caused by: java.lang.NoSuchMethodException: MsgTextView(Context,AttributeSet).. But I have defined this constructor.
だけusee com.android.smsapp.MsgTextViewとは –