title: Activity Is Taking Too Much Time To Load
body: <p>I am a beginner at android. I have created a recyclerview which parses data from a JSON. I have set an onclick listener to all recyclerview item which opens new activity and show details of the recycler view item. My problem is when I click a recyclerview item it takes 4-5 seconds to load can I make this faster please help.</p>
  
  <p>My Activity Code</p>
  
  <pre><code>public class Tab1 extends Fragment implements ExampleAdapter.onItemClickListener{
      private RecyclerViewPager mRecyclerView;
      private ExampleAdapter mExampleAdapter;
      private ArrayList&lt;ExampleItem&gt; mExampleList;
      private RequestQueue mRequestQueue;
      public static final String EXTRA_URL = "imageUrl";
      private ShimmerFrameLayout mShimmerViewContainer;
      Button sharebuttonz;
      File imagePathz;
      @Nullable
      @Override
  
      public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
          ((AppCompatActivity) getActivity()).getSupportActionBar().hide();
          View rootView = inflater.inflate(R.layout.tab1, container, false);
          mRecyclerView = rootView.findViewById(R.id.recycler_view);
          mRecyclerView.setHasFixedSize(true);
          mShimmerViewContainer = rootView.findViewById(R.id.shimmer_view_container);
          mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity(), LinearLayoutManager.VERTICAL, false));
          mExampleList = new ArrayList&lt;&gt;();
          mRequestQueue = Volley.newRequestQueue(getActivity().getApplicationContext());
  
  
          // Set the adapter here.
          // Use getActivity() instead of getContext()
          parseJson();
          mExampleAdapter = new ExampleAdapter(getActivity(), mExampleList);
          mRecyclerView.setAdapter(mExampleAdapter);
          mExampleAdapter.setOnItemClickListener(Tab1.this);
  
  
        return rootView;
      }
  
  
  
      private void parseJson() {
          String url = "http://maranamassapp.cf/json_getdata.php";
          JsonObjectRequest request = new JsonObjectRequest(Request.Method.GET, url, null,
                  new Response.Listener&lt;JSONObject&gt;() {
                      @Override
                      public void onResponse(JSONObject response) {
                          try {
                              JSONArray jsonArray = response.getJSONArray("server_response");
                              for (int i = 0; i &lt; jsonArray.length(); i++) {
                                  JSONObject ser = jsonArray.getJSONObject(i);
                                  String creatorname = ser.getString("head");
                                  String imageUrl = ser.getString("image");
                                  String cat = ser.getString("content");
                                  String postdate = ser.getString("weburl");
                                  String dateall = ser.getString("date");
                                  int type = ser.getInt("type");
  
                                  mExampleList.add(new ExampleItem(imageUrl, creatorname, cat, postdate, dateall,type));
                              }
  
  
  
                              // Just call notifyDataSetChanged here
                              mExampleAdapter.notifyDataSetChanged();
                              mShimmerViewContainer.stopShimmerAnimation();
                              mShimmerViewContainer.setVisibility(View.GONE);
                          } catch (JSONException e) {
                              e.printStackTrace();
                          }
                      }
                  }, new Response.ErrorListener() {
              @Override
              public void onErrorResponse(VolleyError error) {
                  error.printStackTrace();
              }
          });
  
          mRequestQueue.add(request);
      }
  
  
          public void onItemClick(int position) {
              Intent detailintent = new Intent(getContext(), DetailActivity.class);
              ExampleItem clickeditem = mExampleList.get(position);
              detailintent.putExtra(EXTRA_URL, clickeditem.getmDate());
              startActivity(detailintent);
      }
  }
  </code></pre>
  
  <p>My Adapter Code</p>
  
  <pre><code>public class ExampleAdapter extends RecyclerView.Adapter&lt;RecyclerView.ViewHolder&gt; {
      private Context mContext;
      private ArrayList&lt;ExampleItem&gt; mExampleList;
      private onItemClickListener mListener;
  
  
      public interface onItemClickListener {
          void onItemClick(int position);
      }
  
      public void setOnItemClickListener(onItemClickListener listener) {
          mListener = listener;
      }
  
      public class ExampleViewHolder extends RecyclerView.ViewHolder {
          public ImageView mImageView;
          public TextView mTextViewCreator;
          public TextView mTextViewCat;
          public TextView mDateAll;
  
          public ExampleViewHolder(View itemView) {
              super(itemView);
              mImageView = itemView.findViewById(R.id.image_view);
              mTextViewCreator = itemView.findViewById(R.id.text_view_creator);
              mTextViewCat = itemView.findViewById(R.id.text_view_cat);
              mDateAll = itemView.findViewById(R.id.date_views);
              itemView.setOnClickListener(new View.OnClickListener() {
                  @Override
                  public void onClick(View view) {
                      if (mListener != null) {
                          int position = getAdapterPosition();
                          if (position != RecyclerView.NO_POSITION) {
                              mListener.onItemClick(position);
                          }
                      }
                  }
              });
          }
      }
  </code></pre>