In my first fragment I have a listener which listens for a click and when that click occurs I would like to open up another fragment and pass data to it. I would like to know how I can pass data between two fragments here is what I have so far.
This is what I have in the first fragment
classificationGroup = group;
aq.id(R.id.tv_group).text(LogGroup.GROUP_NAMES[group]);
aq.id(R.id.tv_total).text("" + usage + " calls");
Intent intent = new Intent(getActivity(), CallLogsFragment.class);
Bundle b = new Bundle();
b.putInt("key",classificationGroup);
intent.putExtras(b);
startActivity(intent);
This is what I have in second fragment
**Bundle b = getIntent().getExtras();
if(b != null)
value = b.getInt("key");
if (getIntent().getIntExtra("Key", 0) != 0) {
}**