When you get the TextView
reference from your view hierarchy using findViewById()
, you'll get a null
if the view is not there. So just use something along the lines of
TextView tv = (TextView)someView.findViewById(R.id.yourTextViewId);
if (tv != null) {
// The TextView is there and can be used
} else {
// The TextView isn't there
}