0
How to call a method that is within my java Fragment through the onclick of a button contained in the same Fragment? Follow code:
public class Fragmentminhaconta extends Fragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){
View view = inflater.inflate(R.layout.layout_fragment_minhaconta, null);
Button botao = (Button) view.findViewById(R.id.editarMinhasInformacoes);
return (view);
}
public void clicar(View v){
mostrarMsg("Titulo teste", "Mensagem teste");
}
public void mostrarMsg(String titulo, String mensagem) {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
builder.setCancelable(true);
builder.setTitle(titulo);
builder.setMessage(mensagem);
builder.show();
}
}
Thank you. Solved my problem.
– mahenrocha