Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. ublic class LOneFragment extends Fragment {
  2.  
  3. public LOneFragment() {
  4. // Required empty public constructor
  5. }
  6.  
  7. @Override
  8. public void onCreate(Bundle savedInstanceState) {
  9. super.onCreate(savedInstanceState);
  10.  
  11. }
  12.  
  13. @Override
  14. public View onCreateView(LayoutInflater inflater, ViewGroup container,
  15. Bundle savedInstanceState) {
  16. // Inflate the layout for this fragment
  17. View rootView = inflater.inflate(R.layout.fragment_blank, container, false);
  18.  
  19. RecyclerView rv = (RecyclerView) rootView.findViewById(R.id.rv_recycler_view);
  20. rv.setHasFixedSize(true);
  21. MyAdapter adapter = new MyAdapter(new String[]{"League One News", "AFC Wimbledon", "Blackburn Rovers", "Blackpool", "Bradford City", "Bristol Rovers", "Bury", "Charlton Athletic", "Doncaster Rovers", "Fleetwood Town",
  22. "Gillingham", "Milton Keynes Dons", "Northampton Town", "Oldham Athletic", "Oxford United", "Peterborough United", "Plymouth Argyle", "Portsmouth", "Rochdale", "Rotherham United",
  23. "Scunthorpe United", "Shrewsbury Town", "Southend United", "Walsall", "Wigan Athletic"});
  24. rv.setAdapter(adapter);
  25.  
  26. LinearLayoutManager llm = new LinearLayoutManager(getActivity());
  27. rv.setLayoutManager(llm);
  28.  
  29. return rootView;
  30. }
  31.  
  32. public void onListItemClick(ListView l, View v, int position, long id) {
  33. if (position == 3) {
  34. Intent intent = new Intent(getContext(), Bradford.class);
  35. startActivity(intent);
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement