-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHomefragment.java
More file actions
50 lines (34 loc) · 1.26 KB
/
Copy pathHomefragment.java
File metadata and controls
50 lines (34 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package com.example.loginpage.Home;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;
import com.example.loginpage.R;
import org.json.JSONObject;
import java.util.ArrayList;
/**
* A simple {@link Fragment} subclass.
*/
public class Homefragment extends Fragment {
private RecyclerView rv;
ArrayList<DistrictModel> districtModels;
public Homefragment() {
// Required empty public constructor
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View v = inflater.inflate(R.layout.fragment_homefragment, container, false);
rv = v.findViewById(R.id.homerecyclerview);
RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(getActivity());
rv.setLayoutManager(layoutManager);
MyTask task = new MyTask(getActivity(), rv);
task.execute();
return v;
}
}