content: package com.example.sparsh.phone_book;
  
  import android.content.ClipData;
  import android.content.Context;
  import android.content.Intent;
  import android.database.Cursor;
  import android.net.Uri;
  import android.os.Bundle;
  import android.support.annotation.NonNull;
  import android.support.annotation.Nullable;
  import android.support.design.widget.FloatingActionButton;
  import android.support.v4.app.Fragment;
  import android.telecom.Call;
  import android.view.LayoutInflater;
  import android.view.MotionEvent;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.ArrayAdapter;
  import android.widget.Button;
  import android.widget.ListView;
  import android.widget.Spinner;
  import android.widget.TextView;
  
  import java.util.ArrayList;
  import java.util.Collections;
  import java.util.zip.Inflater;
  
  public class Calls extends Fragment  {
  
      static ArrayList<String> alist = new ArrayList<>();
      FloatingActionButton fab7;
      ListView list;
      String []types = {"All Calls","Missed Calls","Outgoing Calls","Recieved Calls"};
  
      private static final String ARG_PARAM1 = "param1";
      private static final String ARG_PARAM2 = "param2";
  
  
      private String mParam1;
      private String mParam2;
  
      private OnFragmentInteractionListener mListener;
  
  
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,
                               Bundle savedInstanceState)
      {
  
          View view = inflater.inflate(R.layout.fragment_calls,container,false);
          Spinner spinner = view.findViewById(R.id.types);
          list = view.findViewById(R.id.list);
          fab7 = view.findViewById(R.id.fab7);
  
          fab7.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View view) {
                  getActivity().finish();
                  startActivity(new Intent(getContext(), MainActivity.class));
              }
          });
  
          ArrayAdapter adapter = new ArrayAdapter(getContext(),android.R.layout.select_dialog_item,types);
          spinner.setAdapter(adapter);
  
          ArrayAdapter adapter1 = new ArrayAdapter(getContext(),android.R.layout.simple_list_item_1,alist);
          list.setAdapter(adapter1);
  
          return view;
      }
  
  
      @Override
      public void onAttachFragment(Fragment childFragment) {
          super.onAttachFragment(childFragment);
      }
  
      public Calls() {
          // Required empty public constructor
      }
  
      // TODO: Rename and change types and number of parameters
      public static Calls newInstance(String param1, String param2) {
          Calls fragment = new Calls();
          Bundle args = new Bundle();
          args.putString(ARG_PARAM1, param1);
          args.putString(ARG_PARAM2, param2);
          fragment.setArguments(args);
          return fragment;
      }
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          if (getArguments() != null) {
              mParam1 = getArguments().getString(ARG_PARAM1);
              mParam2 = getArguments().getString(ARG_PARAM2);
          }
      }
  
      // TODO: Rename method, update argument and hook method into UI event
      public void onButtonPressed(Uri uri) {
          if (mListener != null) {
              mListener.onFragmentInteraction(uri);
          }
      }
  
      @Override
      public void onAttach(Context context) {
          super.onAttach(context);
          if (context instanceof OnFragmentInteractionListener) {
              mListener = (OnFragmentInteractionListener) context;
          } else {
              throw new RuntimeException(context.toString()
                      + " must implement OnFragmentInteractionListener");
          }
      }
  
      @Override
      public void onDetach() {
          super.onDetach();
          mListener = null;
      }
  
  
      public interface OnFragmentInteractionListener {
          // TODO: Update argument type and name
          void onFragmentInteraction(Uri uri);
      }
  }
  
  
  