Forget Wifi network

I use a Raspberry pi to create a hotspot where the Kodular App connects to, and in a specific situation the hostpost has to change its password from the raspberry pi and I would like the app to be able to reconnect to the same wifi hotspot with the new password but I can only do it after I manually click on “Forget” in the phone wifi settings for that AP.

What I would like to know is if there is a way to tell Android to forget this connection or to force it to change the password?

Can i do that with Activity Starter?

I use TailfunWifi extension

Thanks!

EDIT:

I think build an extension in order to run some Java code can be the solution.
i try with editor.appybuilder to create an extension with the following Java code:

  WifiNetworkSuggestion.Builder builder = new WifiNetworkSuggestion.Builder();
  builder.setSsid(SSID);
  builder.setWpa2Passphrase(password);
  WifiNetworkSuggestion suggestion = builder.build();

  ArrayList<WifiNetworkSuggestion> list = new ArrayList<>();
  list.add(suggestion);

  WifiManager manager = (WifiManager) getSystemService(Context.WIFI_SERVICE);
  int status = manager.addNetworkSuggestions(list);

  /*if (status == STATUS_NETWORK_SUGGESTIONS_SUCCESS) {
    //We have successfully added our wifi for the system to consider
    //wifiLog("Connection Successful");
  }
  else{
    //wifiLog("Connection failed");
  }*/
  return status;

editor.appybuilder is super slow for developing and debuging, any other solution to compile my code without installing Android SDK and staff?