Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ublic class LOneFragment extends Fragment {
- public LOneFragment() {
- // Required empty public constructor
- }
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
- @Override
- public View onCreateView(LayoutInflater inflater, ViewGroup container,
- Bundle savedInstanceState) {
- // Inflate the layout for this fragment
- View rootView = inflater.inflate(R.layout.fragment_blank, container, false);
- RecyclerView rv = (RecyclerView) rootView.findViewById(R.id.rv_recycler_view);
- rv.setHasFixedSize(true);
- 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",
- "Gillingham", "Milton Keynes Dons", "Northampton Town", "Oldham Athletic", "Oxford United", "Peterborough United", "Plymouth Argyle", "Portsmouth", "Rochdale", "Rotherham United",
- "Scunthorpe United", "Shrewsbury Town", "Southend United", "Walsall", "Wigan Athletic"});
- rv.setAdapter(adapter);
- LinearLayoutManager llm = new LinearLayoutManager(getActivity());
- rv.setLayoutManager(llm);
- return rootView;
- }
- public void onListItemClick(ListView l, View v, int position, long id) {
- if (position == 3) {
- Intent intent = new Intent(getContext(), Bradford.class);
- startActivity(intent);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement