title: Android Studio Wrong 1st argument type. Found 'java.lang.String', required 'int'
body: <p>Good Day</p>
  
  <p>I have search the website but could not get anything to help me in my problem.
  I`m a newby to android and started a project that I just can not complete.</p>
  
  <p>using Android Studio 2.3
  app name "Match Tracker"</p>
  
  <p>Ok here it go's
  example my app allows you to track a match "Rugby" now I would like the app to auto add points to the leader board if a team has 4 or more tries and that is where I get stuck!!</p>
  
  <p>my FactDBAdaptor.class </p>
  
  <p>EDITED*******</p>
  
  <pre><code>    package za.co.sanrl.rugbyleague.database;
  
  
  import android.content.ContentValues;
  import android.content.Context;
  import android.database.Cursor;
  import android.database.SQLException;
  import android.database.sqlite.SQLiteDatabase;
  import android.util.Log;
  
  import za.co.sanrl.rugbyleague.main.MatchEvent;
  
  import java.util.ArrayList;
  
  /**
   * Class that allows interaction with the Facts database such as insert, delete, update.
   *
   * @author Morne van Rooyen
   */
  public class FactsDbAdapter {
  
      public static final String KEY_MATCHID  = "match_id";
      public static final String KEY_TYPE     = "type";
      public static final String KEY_PLAYER1  = "player1";
      public static final String KEY_PLAYER2  = "player2";
      public static final String KEY_TEAM     = "team";
      public static final String KEY_TIME     = "time";
      private static final String DB_TABLE    = "Facts";
      private SQLiteDatabase db;
      private BaseHelper dbHelper;
      private Context context;
  
      public FactsDbAdapter(Context context) {
          this.context = context;
      }
  
      /**
       * Open database so we can write to it.
       *
       * @return Open DB connection
       * @throws SQLException
       */
      public FactsDbAdapter open() throws SQLException {
          dbHelper = new BaseHelper(context);
          db = dbHelper.getWritableDatabase();
          return this;
      }
  
      /**
       * Close database.
       */
      public void close() {
          dbHelper.close();
      }
  
  
      /**
       * Add a match fact to the database.
       *
       * @param match_id Match ID
       * @param type     Goal, penalty etc.
       * @param player1  First player involved in event
       * @param player2  Second player involved in event
       * @param team     The player(s) team
       * @param time     The time event took place
       */
      public void addMatchFact(int match_id, String type, String player1, String player2, String team, String time) {
  
          ContentValues values = new ContentValues();
          values.put(KEY_MATCHID, match_id);
          values.put(KEY_TYPE, type);
          values.put(KEY_PLAYER1, player1);
          values.put(KEY_PLAYER2, player2);
          values.put(KEY_TEAM, team);
          values.put(KEY_TIME, time);
  
          //Insert into database.
          try {
              db.insert(DB_TABLE, null, values);
          } catch (Exception e) {
              Log.e("Database error when inserting match fact", e.toString());
              e.printStackTrace();
          }
      }
  
      /**
       * Get the column values for a specific column provided.
       *
       * @param column     - column you want to query.
       * @param duplicates - if you want duplicate results.
       * @return columnlist
       */
      public ArrayList&lt;String&gt; getColumnValues(String column, boolean duplicates) {
          Cursor cursor                   = null;
          ArrayList&lt;String&gt; columnList    = new ArrayList&lt;&gt;();
  
          //Get column values.
          try {
              if (duplicates) {
                  cursor = db.rawQuery("SELECT " + column + " FROM " + DB_TABLE, null);
              } else {
                  cursor = db.rawQuery("SELECT DISTINCT " + column + " FROM " + DB_TABLE, null);
              }
          } catch (Exception e) {
              Log.e("Database error selecting facts", e.toString());
              e.printStackTrace();
          }
  
          //Query result is not empty.
          if (cursor != null &amp;&amp; cursor.moveToFirst()) {
              int columnIndex = cursor.getColumnIndex(column);
  
              do {
                  columnList.add(cursor.getString(columnIndex));
              } while (cursor.moveToNext());
          }
  
          return columnList;
      }
  
      /**
       * Count number of types with a given match_id.
       *
       * @param match_id Match ID
       * @param type     Event Type
       * @param teamName Team Name
       * @return count of types
       */
      public int countTypesWithMatchID(int match_id, String type, String teamName) {
          Cursor cursor                   = null;
          ArrayList&lt;String&gt; columnList    = new ArrayList&lt;&gt;();
  
          //Get column values.
          try {
              cursor = db.rawQuery("SELECT " + KEY_TYPE + " FROM " + DB_TABLE +
                      " WHERE " + KEY_TYPE + "=? AND " + KEY_MATCHID + "=" + match_id +
                      " AND " + KEY_TEAM + "=?", new String[]{type, teamName});
          } catch (Exception e) {
              Log.e("Database error counting match events", e.toString());
              e.printStackTrace();
          }
  
          //Query result is not empty.
          if (cursor != null &amp;&amp; cursor.moveToFirst()) {
              int typeIndex = cursor.getColumnIndex(KEY_TYPE);
  
              do {
                  columnList.add(cursor.getString(typeIndex));
              } while (cursor.moveToNext());
          }
  
          return columnList.size();
      }
  /**Count 4 or more tries in a match begins**/
      /**
       * Count number of types with a given match_id.
       *
       * @param match_id Match ID
       * @param type     type is Tries
       * @param teamName Team Name
       * @return count of types
       */
      public int countTriesWithMatchID(int match_id, String type, String teamName) {
          Cursor cursor   = null;
          int result      = 0;
  
          //Get column values.
          try {
              cursor = db.rawQuery("SELECT COUNT(" + KEY_TYPE + ") FROM " + DB_TABLE +
                      " WHERE " + KEY_TYPE + "=Try AND " + KEY_MATCHID + "=" + match_id +
                      " AND " + KEY_TEAM + "=?", new String[]{type, teamName});
          } catch (Exception e) {
              Log.e("Database error counting match events", e.toString());
              e.printStackTrace();
          }
  
          //Query result is not empty.
          if (cursor != null &amp;&amp; cursor.moveToFirst()) {
              result = cursor.getInt(0);
          }
  
          return result;
      }
  
  /**Count 4 or more tries in a match ends**/
  
  
      /**
       * Count the number a certain type with a certain player name comes up in db.
       *
       * @param type   Event Type
       * @param player Player involved in event
       * @return count of types involving a specific player
       */
      public int countTypesWithPlayer(String type, String player) {
          Cursor cursor   = null;
          int result      = 0;
  
          //Get column values.
          try {
              cursor = db.rawQuery("SELECT COUNT(" + KEY_TYPE + ") FROM " + DB_TABLE +
                              " WHERE " + KEY_TYPE + "=? AND " + KEY_PLAYER1 + "=?", new String[]{type, player});
          } catch (Exception e) {
              Log.e("Db err counting type of events involving a player", e.toString());
              e.printStackTrace();
          }
  
          //Query result is not empty.
          if (cursor != null &amp;&amp; cursor.moveToFirst()) {
              result = cursor.getInt(0);
          }
  
          return result;
      }
  
      /**
       * Get all match facts for a given match id.
       *
       * @param match_id Match ID
       * @return All match facts
       */
      public ArrayList&lt;MatchEvent&gt; getAllFactsForGivenMatchID(int match_id) {
          Cursor cursor                   = null;
          ArrayList&lt;MatchEvent&gt; result    = new ArrayList&lt;&gt;();
  
          //Get column values.
          try {
              cursor = db.rawQuery("SELECT * FROM " + DB_TABLE + " WHERE match_id=" + match_id, null);
          } catch (Exception e) {
              Log.e("Db err select * events", e.toString());
              e.printStackTrace();
          }
  
          //Query result is not empty.
          if (cursor != null &amp;&amp; cursor.moveToFirst()) {
              int typeIndex       = cursor.getColumnIndex(FactsDbAdapter.KEY_TYPE);
              int player1Index    = cursor.getColumnIndex(FactsDbAdapter.KEY_PLAYER1);
              int player2Index    = cursor.getColumnIndex(FactsDbAdapter.KEY_PLAYER2);
              int teamIndex       = cursor.getColumnIndex(FactsDbAdapter.KEY_TEAM);
              int timeIndex       = cursor.getColumnIndex(FactsDbAdapter.KEY_TIME);
  
              do {
                  String type         = cursor.getString(typeIndex);
                  String player1      = cursor.getString(player1Index);
                  String player2      = cursor.getString(player2Index);
                  String team         = cursor.getString(teamIndex);
                  String time         = cursor.getString(timeIndex);
  
                  if (player2 != null) {
                      MatchEvent matchEvent = new MatchEvent(time, type, player1, player2, team);
                      result.add(matchEvent);
                  } else {
                      MatchEvent matchEvent = new MatchEvent(time, type, player1, team);
                      result.add(matchEvent);
                  }
  
              } while (cursor.moveToNext());
          }
  
          return result;
      }
  
  }
  </code></pre>
  
  <p>now in my RugbyActivity.class the part that does not work is this</p>
  
  <pre><code>int bpts = factsDbAdapter.countTriesWithMatchID(factsDbAdapter.KEY_MATCHID, factsDbAdapter.KEY_TYPE, factsDbAdapter.KEY_TEAM);
                          if (bpts&lt;3) 
  </code></pre>
  
  <p>can anyone help me or steer me in the right direction please better discription of the code below</p>
  
  <pre><code>switch (status) {
                  case WIN: {// Team won the match.
                      int totalWins = teamAdapter.getColumnValueForTeamInt(teamAdapter.KEY_WINS, team);
                      int totalPoints = teamAdapter.getColumnValueForTeamInt(teamAdapter.KEY_TOTALPOINTS, team);
                      int totalBonusPoints = teamAdapter.getColumnValueForTeamInt(teamAdapter.KEY_BONUSPOINTS, team);
                      teamAdapter.updateSingleColumn(team, teamAdapter.KEY_WINS, totalWins + 1);
                      int bpts = factsDbAdapter.countTriesWithMatchID(factsDbAdapter.KEY_MATCHID, factsDbAdapter.KEY_TYPE, factsDbAdapter.KEY_TEAM);
                      if (bpts&lt;3) {
                          teamAdapter.updateSingleColumn(team, teamAdapter.KEY_BONUSPOINTS, totalBonusPoints + 1);
                          teamAdapter.updateSingleColumn(team, teamAdapter.KEY_TOTALPOINTS, totalPoints + 5);
                      }
                      else
                      {
                          teamAdapter.updateSingleColumn(team, teamAdapter.KEY_TOTALPOINTS, totalPoints + 4);
                      }
                      break;
                  }
  </code></pre>
  
  <p>Thank you in advance</p>