t
is not initialized anywhere. You have only initialize tbx
and also there is a possibility that TextView
belongs to PlaceholderFragment
.
Edit:
Form your comment you say you have tbx.setText("H.H");
Likely the textview belongs to fragment and you should initialize textview in PlaceholderFragment
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_main, container, false);
TextView tbx = (TextView)rootView.findViewById(R.id.tbxName);
tbx.setText("H.H");
return rootView;
}
Edit 2:
You problem has nothing to do with ADT v22.6.2
. You are probably getting NullPointerException
You reference wrong id .
<TextView
android:id="@+id/tbx"
Change this
TextView tbx = (TextView)findViewById(R.id.tbxName);
to
TextView tbx = (TextView)findViewById(R.id.tbx);