I am implementing tabs using FragmentTabHost of v4 support library.

My first tab contains the list of items.When I click on list item it should move to tab 2.
My second tab shows the description of the list item.So I need to pass the list of the first tab and the index of list item clicked to the second tab.

I am currently using getters and setters at application level. But is there any other way to do so? What is the best way to do this?

First fragment-Tab-0

```
@Override
public void onAttach(Activity activity) {
    // TODO Auto-generated method stub
    super.onAttach(activity);

    try {
        mCallback = (OnRadioSelectedListener) activity;
    } catch (ClassCastException e) {
        throw new ClassCastException(activity.toString()
                + " must implement OnHeadlineSelectedListener");
    }
}

@Override
public void onListItemClick(ListView l, View v, int position, long id) {
    // TODO Auto-generated method stub
    super.onListItemClick(l, v, position, id);          
        mCallback.onRadioSelected(dataList, position);
}

public interface OnRadioSelectedListener {
    public void onRadioSelected(ArrayList<DataModel> playingList, int   playingIndex);
}

```

Tabhost activity code:

```
@Override
    public void onRadioSelected(ArrayList<DataModel> playingList, int playingIndex) {
        mPlayingIndex = playingIndex;
        mPlayingList = playingList;

       fragmentTabHost.setCurrentTab(1);
        Fragment2 frag = (Fragment2) getSupportFragmentManager().findFragmentByTag(getString(R.string.str));
    if (frag != null) {
        Bundle args = new Bundle();
        args.putSerializable("Key_list", mPlayingList);
        args.putInt("Key_current_index", mPlayingIndex);
        frag.setArguments(args);
    }

}

```

first time frag is null and second time it gives the exception