Transferring user clicked/swiped item from one listview in 1st fragment to another listview in 2nd fragment
<p>I need to know how we can move an item from a listview on 1st fragment to another listview on 2nd fragment.Below is the code for 2 fragments and the xml file which contains views for list items.
<strong>AbsentStudentFragment.java</strong></p>

<p><strong>Edit:</strong>
I have replace all the arrays with array list and I am generating data for list adapter using Arraylist with a simple POJO class.
Please check below.My question is how can I use the values I am getting from list item like name,confidence etc or the POJO I am getting of type StudentDetails and add those values to the PresentStudent arraylist in PresentStudent fragment.?</p>

<pre><code>public class AbsentStudentFragment extends Fragment
{
ListView listForAbsentStudents;
Context context;


    public View onCreateView(LayoutInflater inflater, final ViewGroup container, Bundle savedInstanceState)
    {
       final ArrayList&lt;StudentDetails&gt; stuAbsent= new ArrayList&lt;&gt;();

    stuAbsent.add(new StudentDetails("name","nameNot",R.mipmap.user));
    stuAbsent.add(new StudentDetails("81","checkName",R.mipmap.user));
    stuAbsent.add(new StudentDetails("60","3rd",R.mipmap.user));

    View view = inflater.inflate(R.layout.fragment_absent_students, container,false);
    context=getActivity();
    listForAbsentStudents=(ListView)view.findViewById(R.id.listview_for_absent_students);
  final AdapterForAbsentList adapterForAbsentList=new    AdapterForAbsentList(context,stuAbsent);
       listForAbsentStudents.setAdapter(adapterForAbsentList);
        listForAbsentStudents.setOnItemClickListener(new AdapterView.OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {
                 //what to do here.?
                //Added below code now
            StudentDetails studentDetails4;
            studentDetails4=stuAbsent.get(position);

            String temName=studentDetails4.getStudentName();
            String tempConfidence=studentDetails4.getStudentConfidence();
            int tempImage=studentDetails4.getStudentImage();
 //Now how can I add these values to presentstudent array list in PresentStudent.java fragment.?

                         //presentStudentFragment.addToPresentStudents(temName,tempConfidence,tempImage);
                   Toast.makeText(getContext(),"value"+temName,Toast.LENGTH_SHORT).show();
        }
    });
        return view;
    }
    public class AdapterForAbsentList extends BaseAdapter
    {

  public AdapterForAbsentList(Context   mContext,ArrayList&lt;StudentDetails&gt;absentStudents) 
{
        this.absentStudents2 = absentStudents;

this.mContext = mContext;
    }

    ArrayList&lt;StudentDetails&gt; absentStudents2;
    private Context mContext;



    @Override
    public int getCount() {
        return absentStudents2.size();;
    }

    @Override
    public Object getItem(int i) {
        return null;
    }

    @Override
    public long getItemId(int i) {
        return 0;
    }

    @Override
    public View getView(int i, View convertView, ViewGroup viewGroup) {
        View viewForListView;
        LayoutInflater inflater = (LayoutInflater) mContext
                .getSystemService(Context.LAYOUT_INFLATER_SERVICE);

        if (convertView == null)
        {
 viewForListView =inflater.inflate(R.layout.custom_row_for_absent_list,null);
            TextView txtConfidence=(TextView)viewForListView.findViewById(R.id.txtConfidence_Temp);
            TextView txtName=(TextView)viewForListView.findViewById(R.id.txtName_Temp);
            ImageView imgStudentThumbnail=(ImageView)viewForListView.findViewById(R.id.imgFile_Temp);
           txtConfidence.setText(absentStudents2.get(i).getStudentConfidence());
            txtName.setText(absentStudents2.get(i).getStudentName());
            imgStudentThumbnail.setImageResource(absentStudents2.get(i).getStudentImage());

        }
        else
        {
            viewForListView = convertView;
        }
        return viewForListView;
    }
    }
    }
</code></pre>

<p>And <strong>PresentStudentFragment.java</strong>
<strong>Edited</strong> Added the arraylist.<br>
<strong>How should I add values I am getting from array list on AbsentStudentFragment.java to the ArrayList listPresentStudents..?</strong> </p>

<pre><code>public class PresentStudentFragment extends Fragment {
ListView listForPresentStudents;
 public ArrayList&lt;StudentDetails&gt;listPresentStudents=new ArrayList&lt;&gt;();
Context context;
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
    View view = inflater.inflate(R.layout.fragment_present_students, container, false);
    context=getActivity();
        listPresentStudents.add(new StudentDetails("80","saurabh",R.mipmap.user));
    listPresentStudents.add(new StudentDetails("60","pqr",R.mipmap.user));

    listForPresentStudents=(ListView)view.findViewById(R.id.listview_for_present_students);

 AdapterForPresentList adapterForPresentListNew=new AdapterForPresentList(context,listPresentStudents);

   listForPresentStudents.setAdapter(adapterForPresentList);
    return view;
    }
 public class AdapterForPresentList extends BaseAdapter 
 {

    private Context mContext;
    ArrayList&lt;StudentDetails&gt;abc;


    public AdapterForPresentList(Context context,    ArrayList&lt;StudentDetails&gt;pqr) 
 {
        this.mContext=context;
        this.abc = pqr;
 }
    @Override
    public int getCount() {
        return abc.size();;
    }
    @Override
    public Object getItem(int i) {
        return null;
    }
    @Override
    public long getItemId(int i) {
        return 0;
    }
    @Override
    public View getView(int i, View convertView, ViewGroup viewGroup)
    {
        View viewForListView;
        LayoutInflater inflater = (LayoutInflater) mContext
                .getSystemService(Context.LAYOUT_INFLATER_SERVICE);

        if (convertView == null)
        {
            viewForListView = inflater.inflate(R.layout.custom_row_for_present_list, null);
            TextView txtConfidence=(TextView)viewForListView.findViewById(R.id.txtConfidence_Temp2);
            TextView txtName=(TextView)viewForListView.findViewById(R.id.txtName_Temp2);
            ImageView imgStudentThumbnail=(ImageView)viewForListView.findViewById(R.id.imgFile_Temp2);

       txtName.setText(abc.get(i).getStudentName());
            txtConfidence.setText(abc.get(i).getStudentConfidence());
              imgStudentThumbnail.setImageResource(abc.get(i).getStudentImage());


        } else
        {
            viewForListView = convertView;
        }
        return viewForListView;
    }


    }
    }
</code></pre>

<p>POJO class <strong>StudentDetails.java</strong>  </p>

<pre><code> public class StudentDetails {
 String studentName,studentConfidence;
 int studentImage;

 public StudentDetails() {
 }

 public String getStudentName() {
    return studentName;
 }

 public void setStudentName(String studentName) {
    this.studentName = studentName;
 }

 public String getStudentConfidence() {
    return studentConfidence;
 }

 public void setStudentConfidence(String studentConfidence) {
    this.studentConfidence = studentConfidence;
 }

 public int getStudentImage() {
    return studentImage;
 }

 public void setStudentImage(int studentImage) {
    this.studentImage = studentImage;
 }

 public StudentDetails(String studentName, String studentConfidence, int studentImage) {
    this.studentName = studentName;
    this.studentConfidence = studentConfidence;
    this.studentImage = studentImage;
 }
 }
</code></pre>

<p>And views for list items <strong>custom_row_list</strong></p>

<pre><code> &lt;ImageView
    android:id="@+id/imgFile_Temp2"
    android:layout_width="90dp"
    android:layout_height="90dp"
    android:src="@mipmap/user"
    android:padding="10dp"/&gt;

&lt;LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_toRightOf="@id/imgFile_Temp2"
    android:orientation="vertical"&gt;

    &lt;TextView
        android:id="@+id/txtConfidence_Temp2"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="10dp"
        android:textColor="@android:color/black"
        android:textSize="16sp" /&gt;


    &lt;TextView
        android:id="@+id/txtName_Temp2"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="10dp"
        android:textColor="@android:color/black"
        android:textSize="16sp" /&gt;
</code></pre>

<p>What i need is if I swipe/clicked an item from <code>listForAbsentStudents</code> list then it should get transferred to <code>listForPresentStudents</code> list and that item should be deleted from absent student list.
How can I do this..Forget about doing swiping..it seems distant to me.. 
Please tell me what should I do on <code>onItemclick()</code> method of <code>listview</code> to achieve this.
should I use intents and/or bundle to pass extras..if so how..?
Something along the lines of <code>parent.getItemAt(position)</code>..? </p>