I'm using a Odoo service. And I have 3 fragments in my application.
In each fragment I need log to service:
OdooClient odoo;
odoo = new OdooClient.Builder(getActivity()).setHost(host).build();
odoo.setOnConnectListener(new OdooConnectListener() {
@Override
public void onConnected(OdooVersion version) {
Log.i(TAG,"onConnected");
Log.i(TAG,odoo.getDatabases().toString());
odoo.authenticate(username,password,db,loginCallback);
}
});
There are a way to authenticate just one time for all fragments? I can authenticate on MainActivity, but I can't take the reference of the object.