You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 14, 2018. It is now read-only.
Hi @stephanenicolas this is a superb library. I want to have two service. Can you give me a guide? FYI, my whole activities extend BaseActivity (or below class). If i implement an interface to this class i must call the method on my each sub class activities.
public abstract class BaseActivity extends AppCompatActivity {
private static final String TAG = BaseActivity.class.getSimpleName();
private SpiceManager spiceManager;
public SpiceManager getSpiceManager() {
if(PrefUtils.getPrefCity(getBaseContext()).equals("ABC"))
spiceManager = new SpiceManager(MySecondService.class);
else
spiceManager = new SpiceManager(MyFirstService.class);
return spiceManager;
}
@Override
protected void onStart() {
super.onStart();
spiceManager.start(this);
}
@Override
protected void onStop() {
spiceManager.shouldStop();
super.onStop();
}
}
Before i change to the above class, here is my BaseActivity class
public abstract class BaseActivity extends AppCompatActivity {
private static final String TAG = BaseActivity.class.getSimpleName();
private SpiceManager spiceManager = new SpiceManager(MyFirstService.class);
public SpiceManager getSpiceManager() {
return spiceManager;
}
@Override
protected void onStart() {
super.onStart();
spiceManager.start(this);
}
@Override
protected void onStop() {
spiceManager.shouldStop();
super.onStop();
}
}
Is there any way that give best practices design a spicemanager connect two service?
Or i must create two spice manager? Or is there any way i just check using if statement when getServerUrl() method is executed? Please help. Thanks in advanced.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi @stephanenicolas this is a superb library. I want to have two service. Can you give me a guide? FYI, my whole activities extend BaseActivity (or below class). If i implement an interface to this class i must call the method on my each sub class activities.
Before i change to the above class, here is my BaseActivity class
Is there any way that give best practices design a spicemanager connect two service?
Or i must create two spice manager? Or is there any way i just check using if statement when getServerUrl() method is executed? Please help. Thanks in advanced.
The text was updated successfully, but these errors were encountered: