There is no (secure) form of an "chat" activity directly with another Activity. As Android is architected, different Activities and Services may be in separate processes.
If you wanted to open the other Activity, firing an Intent would be the correct way. But as you do not want, my suggestion is to write the value generated in Activity A in the app configuration:
SharedPreferences prefs;
prefs = PreferenceManager.
getDefaultSharedPreferences(getApplicationContext());
SharedPreferences.Editor ed = prefs.edit();
ed.putInt("numero", x);
ed.apply();
In Activity B you can read the configuration value:
SharedPreferences prefs;
prefs = PreferenceManager.
getDefaultSharedPreferences(getApplicationContext());
int x = prefs.getInt("numero", defaultx);
It is also possible for Actiivty B to sign up for notifications when the setting is changed by Activity A:
prefs.registerOnSharedPreferenceChangeListener(this);
In this case your Activity should implement an interface, and the statement looks like:
public class ActivityB extends Activity
implements SharedPreferences.OnSharedPreferenceChangeListener
and you should declare the method that will be called when some config changes:
public void onSharedPreferenceChanged(
SharedPreferences sharedPreferences, String key) {
if (key.equals("numero")) {
... numero mudou, atualizar o botao ....
}
}