title: How to Call SQLite database delete column ("db.delete") from outside the class the database was created
body: <p>I am required to use a Button defined in fragment 'CheckInFragment.java' to delete data from the database defined outside the fragment. Currently, the deleteCheckIn method is located in CheckInList.java which needs to be called on the delete button defined in the fragment using an OnClickListener. </p>
  
  <p>Currently, I am unable to reference or use / create this method inside the fragment.</p>
  
  <p>I've tried referencing the method inside the fragment but since it requires arguments only stored in CheckInList.java it was unsuccessful. I've tried directly calling the mDataBase.delete without using a method however as the previous attempt it cannot be called without those arguments.</p>
  
  <p>CheckInList.java</p>
  
  <pre><code>...
  
  public class CheckInList {
      private static CheckInList sCheckInList;
      private Context mContext;
      public SQLiteDatabase mDataBase;
  
      public static CheckInList get(Context context) {
          if (sCheckInList == null) {
              sCheckInList = new CheckInList(context);
          }
          return sCheckInList;
      }
  
      public CheckInList(Context context) {
          mContext = context.getApplicationContext();
          mDataBase = new CheckInBaseHelper(mContext).getWritableDatabase();
      }
  
      //REQUIRED METHOD TO BE CALLED
      public void deleteCheckIn(CheckIn c) {
          mDataBase.delete(DATABASE_NAME,  CheckInTable.Cols.UUID + "=" + c, null);
      }
  ...
  </code></pre>
  
  <p>//CheckInFragment.java</p>
  
  <pre><code>@Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
          View v = inflater.inflate(R.layout.fragment_checkin, container, false);
  
  ...
  
  mDeleteButton = (Button) getView().findViewById(R.id.checkin_delete);
          mDeleteButton.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  //call delete method here
              }
          });
  
          return v;
      }
  ...
  </code></pre>
  
  <p>//CheckIn.java (as per comments)</p>
  
  <pre><code>public class CheckIn  {
      private UUID mId;
      private String mTitle;
      private String mPlace;
      private String mDetails;
      private Date mDate;
      private double mLatitude;
      private double mLongitude;
  
  ...
     public UUID getId() {
          return mId;
      }
  ...
  
     public CheckIn() {
          this(UUID.randomUUID());
      }
  
      public CheckIn(UUID id) {
          mId = id;
          mDate = new Date();
      }
  ...
  </code></pre>
  
  <p>I would like to find a way to use deleteCheckIn when the mDeleteButton button is clicked.</p>
  
  <p>Any help is appreciated!</p>