Tenho uma classe GuiaDaCidade
.
public class GuiaDaCidade extends Fragment {
View rootView;
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
rootView = inflater.inflate(R.layout.guia_da_cidade, null);
View botaoPasseios = (View) rootView.findViewById(R.id.btpasseios);
View botaoAgenda = (View) rootView.findViewById(R.id.btagenda);
botaoPasseios.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
startActivity(new Intent(getActivity(),Passeios.class)); ///O que fazer aqui?
}
});
botaoAgenda.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
Uri uri = Uri.parse("http://www.agendanatal.com.br");
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);
}
});
return rootView;
}
E a Classe Passeios
:
public class Passeios extends Fragment {
private ArrayList<HashMap<String, String>> list;
private ExpandableListAdapter listAdapter;
private ExpandableListView expListView;
private List<String> listDataHeader;
private HashMap<String, List<String>> listDataChild;
private WebView webView;
private View rootView;
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
rootView = inflater.inflate(R.layout.guia_passeios, null);
expListView = (ExpandableListView) rootView.findViewById(R.id.listaexp);
prepareListData();
listAdapter = new ExpandableListAdapter(getActivity(), listDataHeader, listDataChild);
expListView.setAdapter(listAdapter);
expandeAll();
expListView.setOnChildClickListener(new ExpandableListView.OnChildClickListener() {
@Override
public boolean onChildClick(ExpandableListView parent, View v,
int groupPosition, int childPosition, long id) {
mudaTela(groupPosition, childPosition);
return false;
}
});
return rootView;
}
Como faco para iniciar a classe Passeios
a partir da classe GuiaDaCidade
?
No metodo onclickListener
da classe GuiaDaCidade
ja tem +/- a ideia teórica do que quero, porem não funciona.