I need that from the click of a button inside my Fragment, it calls an Activity. My code looks like this:
public class ActFoto2 extends Fragment implements View.OnClickListener,
ViewTreeObserver.OnGlobalLayoutListener {
private Button proximo;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setRetainInstance(true);
String caminhoFoto = Util.getUltimaMidia(getActivity(), Util.MIDIA_FOTO);
if (caminhoFoto != null) {
mCaminhoFoto = new File(caminhoFoto);
}
proximo = (Button)getActivity().findViewById(R.id.btnProximo);
proximo.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(getActivity(), ActMapa.class);
startActivity(intent);
}
});
}
}
But even so it does not call, and when I go to test, it for the application. Can someone please help me. Thanks.