title: How do I call an ArrayAdapter function from my Utility class?
body: <p>Hi in my ArrayAdapter class when I click on button I'm showing Alert dialog box. </p>
  
  <p>This alert dialog box and all related coding part is written in my "Common utility" class as like below.</p>
  
  <p>My requirement is when I tap on alert dialogue box <code>OK</code> and <code>CANCEL</code> buttons  I want to handle that click events in my Adapter class </p>
  
  <p>how can I do this please suggest me some one</p>
  
  <h2>CommonUtilities:-</h2>
  
  <pre><code>public class CommonUtils  {
  
     BackGroundDialogeCall backGroundDialogeCall;
  
     public interface BackGroundDialogeCall {
  
        void doDialogueExecute(String result);
     }
  //Adding Dialoge box:-
  
  /**
   *
   */
  
  public void displaySignOutAlertDialog(Context activity) {
  
     new AlertDialog.Builder(activity)
           .setTitle("Alert")
           .setMessage(activity.getResources().getString(R.string.release_alert_title))
           .setPositiveButton(android.R.string.yes,
                 new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog,
                                   int which) {
  
                       dialog.dismiss();
                    }
                 })
           .setNegativeButton(android.R.string.no,
                 new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog,
                                   int which) {
                       dialog.dismiss();
                    }
                 }).show();
     }
  }
  </code></pre>
  
  <h2>Adapterclass:-</h2>
  
  <pre><code>public class StockBookingExpandableAdapter extends BaseExpandableListAdapter implements CommonUtils.BackGroundDialogeCall {
  
      private Context context;
  
      public StockBookingExpandableAdapter(Context context, ArrayList&lt;StockBookingHeaderBean&gt; stockbookingList) {
  
          this.context = context;
      }
  @Override
  public void doDialogueExecute(String result) {
  
      if (result.equals("yes")){
          Log.d("=====&gt;", "111");
      }else{
          Log.d("=====&gt;", "222");
      }
  }
  </code></pre>