how to override sqlite database in android studio using integer as argument

I am making an application in android studio developed in java that allows to show a profile image in imageview and store the url of the location of said image in a database, besides that every time a button is pressed it can be changed the profile image and the path where the new image is located is overwritten. So far I am taking the facebook profile picture and I am storing its url in the table but when I press the button to change the image (which does good way) and try to override the url the value of the field is not modified. The idea is to override the url field of the image from the database by giving as an argument the id of the user associated with said image (which is an integer ). I hope you understand and can help me. Greetings

ConstantUser.class

public class ConstantUser {
    //table user
    public static final String TABLA_USUARIO="usuario";
    public static final String CAMPO_ID="user_id";
    public  static final String CAMPO_FK_ID="id_profile";
    public static final String CAMPO_PASSWORD="password";
    public static final String CAMPO_USERNAME="username";
    public static final String CAMPO_FIRSTNAME="first_name";
    public static final String CAMPO_LASTNAME="last_name";
    public static final String CAMPO_EMAIL="email";
    public static final String CAMPO_DATE="date";
    public static final String CAMPO_DATE_JOINED="date_joined";

    //table perfil_user
    public static final String TABLE_PROFILE="profile";
    public static final String FIELD_ID_PROFILE="id_profile";
    public static final String FIELD_ALIAS="alias";
    public static final String FIELD_REPUTATION="reputation";
    public static final String FIELD_IMAGE="image_perfil";
  public static final String CREAR_TABLA_USUARIO="CREATE TABLE "+TABLA_USUARIO+"("+CAMPO_ID+" INTEGER PRIMARY KEY AUTOINCREMENT,"+CAMPO_PASSWORD+" TEXT,"+
            CAMPO_USERNAME+" TEXT,"+CAMPO_FIRSTNAME+" TEXT,"+CAMPO_LASTNAME+" TEXT,"+CAMPO_EMAIL+" TEXT,"+CAMPO_DATE+
            " TEXT,"+CAMPO_DATE_JOINED+" TEXT,"+CAMPO_FK_ID+" INTEGER,"+" FOREIGN KEY"+"("+CAMPO_FK_ID+")" +
            " REFERENCES "+TABLE_PROFILE+"(id_profile)"+")";

    public static final String CREATE_TABLE_PROFILE="CREATE TABLE "+TABLE_PROFILE+"("+FIELD_ID_PROFILE+" INTEGER PRIMARY KEY AUTOINCREMENT,"+FIELD_ALIAS+" TEXT,"+FIELD_REPUTATION+
            " INTEGER,"+FIELD_IMAGE+" TEXT"+")";
}

sqlitehelper.class

public class ConexionSQliteHelper extends SQLiteOpenHelper {

    public ConexionSQliteHelper(@Nullable Context context, @Nullable String name, @Nullable SQLiteDatabase.CursorFactory factory, int version) {
        super(context, name, factory, version);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {

        db.execSQL(CREAR_TABLA_USUARIO);
        db.execSQL(CREATE_TABLE_PROFILE);
}
 @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        db.execSQL("DROP TABLE IF EXISTS " + TABLA_USUARIO);
        db.execSQL("DROP TABLE IF EXISTS " + TABLE_PROFILE);
}
  public void insertUser(String user_name, String name, String last_name, String date, String date_joined, String alias, String email, String password,String photo) {
        SQLiteDatabase db = this.getWritableDatabase();
        ContentValues values = new ContentValues();
        values.put(FIELD_ALIAS, alias);
        values.put(FIELD_IMAGE,photo);
        values.put(FIELD_REPUTATION, 0);
        Long idresultante = db.insert(TABLE_PROFILE, null, values);
        ContentValues values_2 = new ContentValues();
        values_2.put(CAMPO_PASSWORD,password);
        values_2.put(CAMPO_USERNAME, user_name);
        values_2.put(CAMPO_FIRSTNAME, name);
        values_2.put(CAMPO_LASTNAME, last_name);
        values_2.put(CAMPO_EMAIL, email);
        values_2.put(CAMPO_DATE, date);
        values_2.put(CAMPO_DATE_JOINED, date_joined);
        values_2.put(CAMPO_FK_ID, idresultante);
        Long idresultante_2 = db.insert(TABLA_USUARIO, null, values_2);
        db.close();
    }
  public int requestId(String username){
        Integer id = null;
        SQLiteDatabase db = this.getReadableDatabase();
        Cursor cursor = db.rawQuery(" SELECT "+CAMPO_ID+" FROM " + TABLA_USUARIO + " WHERE " + CAMPO_USERNAME + " =? ", new String[]{username});
        if (cursor != null && cursor.getCount() > 0) {
            if (cursor.moveToFirst()) {
                id = cursor.getInt(0);
            }
        }
        return id;
    }
 public void overWriteImage(String url,String id){
            SQLiteDatabase db = this.getWritableDatabase();
            ContentValues values = new ContentValues();
            values.put(FIELD_IMAGE, stringUri);
            Cursor cursor = db.rawQuery(" SELECT "+FIELD_IMAGE+" FROM " + TABLE_PROFILE + " WHERE " + FIELD_ID_PROFILE+ " =? ", new String[]{id});
            long row = db.update(TABLE_PROFILE,values,FIELD_IMAGE+ " = ?", new String[]{id});
            db.close();

    }

}

Main.class

public class loggin extends AppCompatActivity {
Button buttonSelectImage
 public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view=inflater.inflate(R.layout.perfil_user,container,false);
        buttonSelectImage=view.findViewById(R.id.change_image);
        ConexionSQliteHelper conn=new ConexionSQliteHelper(getContext(),"db_testwuad_7",null,15);
        AccessToken accessToken = AccessToken.getCurrentAccessToken();
         buttonSelectImage.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(Intent.ACTION_PICK,MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
                startActivityForResult(intent,3);

            }
        });
//in this part I get the name, email and profile picture from facebook 
//and store it in the database structure 

//mentioned above and show it in the view

 if ( accessToken != null && !accessToken.isExpired()){
            GraphRequest request = GraphRequest.newMeRequest(
                    accessToken,
                    new GraphRequest.GraphJSONObjectCallback() {
                        @Override
                        public void onCompleted(JSONObject object, GraphResponse response) {
                            try {
                                Blob my_blob= null;
                                facebook_firstname=object.getString("first_name");
                                facebook_lastname =object.getString("last_name");
                                facebook_user_name=object.getString("name");
                                email_facebook = object.getString("email");
                                
                                String url_perfil_facebook=object.getJSONObject("picture").getJSONObject("data").getString("url");
                               
                                Picasso.get().load(url_perfil_facebook).into(image_user);
                                name_user.setText(facebook_user_name);
                                email.setText(email_facebook);
                                str_datefb = date_now;
                                str_datejoinedfb = date_now;
                                tag_date.setText(str_datefb);
                                boolean exist_user = conn.verifyIfUserExists(email_facebook);
                                if (exist_user) {
                                    alias_perfil = conn.getUserName(email_facebook);
                                    alias_facebook = conn.requestAlias(alias_perfil);
                                    alias.setText(alias_facebook);
                                    String last_season =  conn.getLastDateofConnection(facebook_user_name);
                                    tag_date.setText(last_season);
                                    conn.overwriteDate(date_now,facebook_user_name);
                                }

                                else {
                                    alias_name= generateAliasRandom();
                                    conn.insertUser(facebook_user_name,facebook_firstname,facebook_lastname,str_datefb,str_datejoinedfb,alias_name,email_facebook,null,url_perfil_facebook);
                                    Toast.makeText(getContext(), "nuevo usuario creado", Toast.LENGTH_SHORT).show();
                                }

                            } catch (JSONException  e) {
                                e.printStackTrace();
                            }
                        }
                    });

            Bundle parameters = new Bundle();
            parameters.putString("fields","id,first_name,last_name,name,email,link,picture.type(large)");
            request.setParameters(parameters);
            request.executeAsync();

        }
return view
 }

//here I get the url of the new image once the changeimage button is 
//selected and I pass 

//that value to the overwriteimage method along with the user id

 public void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        ConexionSQliteHelper conn=new ConexionSQliteHelper(getContext(),"db_testwuad_7",null,15);
        if(resultCode == RESULT_OK && data != null){
            Uri selectedImage = data.getData();
            image_user.setImageURI(selectedImage);
            String stringUri = selectedImage.toString();
            Toast.makeText(getContext(), "el valor es"+stringUri, Toast.LENGTH_LONG).show();
            int id_user = conn.requestId(name_user.getText().toString());
//convert id integer to string
            String id_string=Integer.toString(id_string);
            conn.overWriteImage(stringUri,id_string);
}}

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum