那么如何将一个函数作为参数传递给另一个函数,例如我想传递这个函数:
public void testFunkcija(){
Sesija.forceNalog(reg.getText().toString(), num);
}
在这:
public static void dialogUpozorenjaTest(String poruka, Context context, int ikona, final Method func){
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(
context);
alertDialogBuilder.setTitle("Stanje...");
alertDialogBuilder
.setMessage(poruka)
.setIcon(ikona)
.setCancelable(true)
.setPositiveButton("OK",new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,int id) {
//here
}
});
AlertDialog alertDialog = alertDialogBuilder.create();
alertDialog.show();
}