I am extending Android BaseAdapter.
In regards to method
getView (int position, View convertView, ViewGroup parent)
The docs say
You should check that this view is non-null and of an appropriate type before using. If it is not possible to convert this view to display the correct data, this method can create a new view.
I am wondering how do I check if the View is of appropriate type?
Lets say I would expect a LinearLayout, with two TextView children? How would I check this properly?
Would this be correct?
if (convertView instanceof LinearLayout) {
if (convertView.findViewById(someid) != null) {
//its what I expect...
}
}