I have a subclass of AutoCompleteTextView which displays the list of
suggestions when a touch event happens. I get a Null Pointer
Exception which I am at a loss as to how to debug.
Thread [<3> main] (Suspended (exception NullPointerException))
DataSetObservable.notifyInvalidated() line: 45
ArrayAdapter(BaseAdapter).notifyDataSetInvalidated() line: 54
ArrayAdapter$ArrayFilter.publishResults(CharSequence, Filter
$FilterResults) line: 464
Filter$ResultsHandler.handleMessage(Message) line: 263
Filter$ResultsHandler(Handler).dispatchMessage(Message) line: 99
Looper.loop() line: 123
ActivityThread.main(String[]) line: 3948
Method.invokeNative(Object, Object[], Class, Class[], Class, int,
boolean) line: not available [native method]
Method.invoke(Object, Object...) line: 521
ZygoteInit$MethodAndArgsCaller.run() line: 782
ZygoteInit.main(String[]) line: 540
NativeStart.main(String[]) line: not available [native method]
It seems like if I could step in to the Android SDK source code I
could see exactly what is going on and come up with a workaround.
Right now I have no idea what is actually going wrong. Any suggestions
as to how to debug this.
There is not much to my code, this is all I have done, It does not
crash when I remove the call to showDropDown():
class SuggestText extends AutoCompleteTextView {
int cnt=0;
public SuggestText(Context context, AttributeSet attrs) {
super(context, attrs);
}
public boolean onTouchEvent(MotionEvent event){
if (this.isFocused() &&
getEditableText().toString().length()==0) {
showDropDown();
}
return super.onTouchEvent(event);
}
}
--
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en