title: How to apply RecycleView in Fragment
body: <p>I have a fragment, the name is galery. in the fragment galery i'll showing a recycleView that contains name list. but i find an error in this script :</p>
  
  <pre class="lang-java prettyprint-override"><code>LinearLayoutManager llm = new LinearLayoutManager(this);
  </code></pre>
  
  <p>and this my full code :</p>
  
  <pre><code>public class galery extends Fragment {
  private RecyclerView lvhape;
  private RequestQueue requestQueue;
  private StringRequest stringRequest;
  
  ArrayList&lt;HashMap&lt;String, String&gt;&gt; list_data;
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
  
  }
  
  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container,
                           Bundle savedInstanceState) {
      View rootView = inflater.inflate(R.layout.fragment_galery, container, false);
      String url = "http://bls.hol.es/read.php";
  
      lvhape = (RecyclerView) rootView.findViewById(R.id.lvhape);
      LinearLayoutManager llm = new LinearLayoutManager(this);
      llm.setOrientation(LinearLayoutManager.VERTICAL);
      lvhape.setLayoutManager(llm);
  
      requestQueue = Volley.newRequestQueue(galery.this);
      list_data = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();
  
      stringRequest = new StringRequest(Request.Method.GET, url, new Response.Listener&lt;String&gt;() {
          @Override
          public void onResponse(String response) {
              Log.d("response", response);
              try {
                  JSONObject jsonObject = new JSONObject(response);
                  JSONArray jsonArray = jsonObject.getJSONArray("result");
                  for (int a = 0; a &lt; jsonArray.length(); a++) {
                      JSONObject json = jsonArray.getJSONObject(a);
                      HashMap&lt;String, String&gt; map = new HashMap&lt;String, String&gt;();
                      map.put("id", json.getString("id"));
                      map.put("nama", json.getString("nama"));
                      map.put("alamat", json.getString("alamat"));
                      map.put("poto", json.getString("poto"));
                      list_data.add(map);
                      AdapterList adapter = new AdapterList(galery.this, list_data);
                      lvhape.setAdapter(adapter);
  
                  }
              } catch (JSONException e) {
                  e.printStackTrace();
              }
          }
      }, new Response.ErrorListener() {
          @Override
          public void onErrorResponse(VolleyError error) {
              Toast.makeText(getActivity().getApplicationContext(), error.getMessage(), Toast.LENGTH_SHORT).show();
          }
      });
      requestQueue.add(stringRequest);
      return rootView;
  }
  </code></pre>
  
  <p>}</p>