I do not know how to work with two fragments, I looked for a few things here but could not find it right.
From Activity
to another I use Bundle
and it works, but I'm not sure how to use it with Fragment.
I'm working with Navigator Drawer that use fragments. one of the fragments I have a ListView and in this ListView I need to call another fragment with ListView as well.
Ex. first Fragment / ListView (Years) - 2016 - 2015 - 2014 - ....
Follow the code I'm using in the first fragment.
lv_Anos.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
// pegas os valores do Text no linha //
TextView txAno = (TextView) view.findViewById(R.id.tx_Ano);
// chamar outro fragment e passar paramentro para ele //
// Variável ->> Param_Ano
}
});
The second fragment / ListView - Editions
I need to receive the Selected Year to generate Json of the second fragment.
Variable Param_Ano
new JSONTask().execute("http://www...../edicaoporano.php?Ano=" + Param_Ano);