I am fairly new to android programming and ran to a small problem. I have an activity that lets users select names from a muli-select listview. I can store it in an ArrayList fine but how do I pass that ArrayList as a bundle to be retrieved from the fragment? Thank you for any future answers.

MainActivity.java:

```
public class MainActivity extends Activity {

ListView myListView;
Button getResult;
ConnectionClass connectionClass;

private ArrayList<String> emp_names_list = new ArrayList<String>();
public ArrayList<Integer> emp_id_list = new ArrayList<Integer>();

MyArrayAdapter myArrayAdapter;

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    connectionClass = new ConnectionClass();
    emp_names_list.add("LOL");

    //PAGKUHA NG RESULTS SA DB
    try {
        Connection con = connectionClass.CONN();
        if (con == null) {
            Toast.makeText(getApplicationContext(), "CONNECTION FAIL", Toast.LENGTH_LONG).show();
        } else {
            String query = "select * from users WHERE user_type=3";
            PreparedStatement ps = con.prepareStatement(query);
            ResultSet rs = ps.executeQuery();

            ArrayList<String> data1 = new ArrayList<String>();
            while (rs.next()) {
                String fname =rs.getString("user_fname");
                String lname =rs.getString("user_lname");
                String name = String.valueOf(fname)+" "+String.valueOf(lname);
                emp_names_list.add(fname);

            }

            Toast.makeText(getApplicationContext(), "FETCH SUCCESS", Toast.LENGTH_LONG).show();
        }
    } catch (Exception ex) {
        Toast.makeText(getApplicationContext(), "FETCH FAIL", Toast.LENGTH_LONG).show();
        Log.e("MYAPP", "exception", ex);

    }

    myListView = (ListView)findViewById(R.id.list);

    //PARA SA LAYOUT
    myArrayAdapter = new MyArrayAdapter(
            this,
            R.layout.row,
            android.R.id.text1,
            emp_names_list
            );

    myListView.setAdapter(myArrayAdapter);
    myListView.setOnItemClickListener(myOnItemClickListener);

    getResult = (Button)findViewById(R.id.getresult);
    getResult.setOnClickListener(new OnClickListener(){

        @Override
        public void onClick(View v) {
            String result = "";

            /*
            //getCheckedItemPositions
            List<Integer> resultList = myArrayAdapter.getCheckedItemPositions();
            for(int i = 0; i < resultList.size(); i++){
                result += String.valueOf(resultList.get(i)) + " ";
            }
            */

            //getCheckedItems
            List<String> resultList = myArrayAdapter.getCheckedItems();
            for(int i = 0; i < resultList.size(); i++){
                result += String.valueOf(resultList.get(i)) + "\n";
            }

            myArrayAdapter.getCheckedItemPositions().toString();
            //Toast.makeText(getApplicationContext(),result, Toast.LENGTH_LONG).show();

            try {
                Connection con = connectionClass.CONN();
                if (con == null) {
                    Toast.makeText(getApplicationContext(), "CONNECTION FAIL", Toast.LENGTH_LONG).show();
                } else {

                    //FOR INSERTION ITO USING ARRAYLIST
                    String samp = "";
                    String names = "";
                    samp = myArrayAdapter.getCheckedItems().toString();
                    List<String> data1 = new ArrayList<String>(Arrays.asList(samp.replace("[","").replace("]","").split(",")));
                    //data1.add(samp);

                    for(String name : data1)
                    {
                        names = name;  

                        String query = "INSERT INTO AUTOINC(PersonName)"+"VALUES('"+names+"')";
                          PreparedStatement preparedStatement =   con.prepareStatement(query);
                          preparedStatement.executeUpdate();

                    }
                    Toast.makeText(getApplicationContext(), "INSERT SUCCESS", Toast.LENGTH_LONG).show();
                }
            } catch (Exception ex) {
                Toast.makeText(getApplicationContext(), "INSERT FAILED", Toast.LENGTH_LONG).show();
                Log.e("MYAPP", "exception", ex);
            }

        }});

}

OnItemClickListener myOnItemClickListener = new OnItemClickListener(){

    @Override
    public void onItemClick(AdapterView<?> parent, View view, int position,
            long id) {
        myArrayAdapter.toggleChecked(position);

    }};

private class MyArrayAdapter extends ArrayAdapter<String>{

    private HashMap<Integer, Boolean> myChecked = new HashMap<Integer, Boolean>();

    public MyArrayAdapter(Context context, int resource,
            int textViewResourceId, List<String> objects) {
        super(context, resource, textViewResourceId, objects);

        for(int i = 0; i < objects.size(); i++){
            myChecked.put(i, false);
        }
    }

    public void toggleChecked(int position){
        if(myChecked.get(position)){
            myChecked.put(position, false);
        }else{
            myChecked.put(position, true);
        }

        notifyDataSetChanged();
    }

    public List<Integer> getCheckedItemPositions(){
        List<Integer> checkedItemPositions = new ArrayList<Integer>();

        for(int i = 0; i < myChecked.size(); i++){
            if (myChecked.get(i)){
                (checkedItemPositions).add(i);
            }
        }

        return checkedItemPositions;
    }

    public List<String> getCheckedItems(){
        List<String> checkedItems = new ArrayList<String>();

        for(int i = 0; i < myChecked.size(); i++){
            if (myChecked.get(i)){
                (checkedItems).add(emp_names_list.get(i));
            }
        }

        return checkedItems;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        View row = convertView;

        if(row==null){
            LayoutInflater inflater=getLayoutInflater();
            row=inflater.inflate(R.layout.row, parent, false);  
        }

        CheckedTextView checkedTextView = (CheckedTextView)row.findViewById(R.id.checkedTextView);
        checkedTextView.setText(emp_names_list.get(position));

        Boolean checked = myChecked.get(position);
        if (checked != null) {
            checkedTextView.setChecked(checked);
        }

        return row;
    }

}

}

```

I have tried the following example but returns null:

```
Bundle bundle=new Bundle();
bundle.putBundle("bundle_DescriptioneTab",bundle_DescriptioneTab);
bundle.putBundle("bundle_User_Review",bundle_User_Review);

```