title: How can i pass a function as a parameter to another function in android?
body: <p>So how can I pass a function as a parameter to another function,  for example i want to pass this function:</p>
  
  <pre><code>public void testFunkcija(){
      Sesija.forceNalog(reg.getText().toString(), num);
  }
  </code></pre>
  
  <p>in this:</p>
  
  <pre><code>    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();
  }
  </code></pre>