Advertisement
realanton12345

TestFragment

Sep 24th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.67 KB | None | 0 0
  1. public class TestFragment extends Fragment {
  2.  
  3.     @Nullable
  4.     @Override
  5.     public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
  6.         return inflater.inflate(R.layout.fragment_layout, container, false);
  7.     }
  8.  
  9.     @Override
  10.     public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
  11.         super.onViewCreated(view, savedInstanceState);
  12.         Button btn = (Button) this.getActivity().findViewById(R.id.button);
  13.         btn.setText("123");
  14.     }
  15.  
  16.     @Override
  17.     public void onCreate(@Nullable Bundle savedInstanceState) {
  18.         super.onCreate(savedInstanceState);
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement