You should call
text=(TextView)view.findViewById(R.id.tt);
onCreateView(), or in the method that is called from onCreateView() before doing anything with it. If text hasn’t been assigned to UI element, TextView throws NullPoint Exception. If you really want that assigning in another method, write a method like
private void initUI()
5
solved Unable to pass data between fragments…..TextView throws NullPoint Exception