mirror of
https://github.com/ChronosX88/Influence.git
synced 2024-11-09 12:01:01 +00:00
The ServiceConnection object is directly put in the AppHelper (anonymous)
This commit is contained in:
parent
65bb540110
commit
64975460d3
@ -140,7 +140,7 @@ public class LoginActivity extends AppCompatActivity implements CoreContracts.IL
|
||||
private void doLogin() {
|
||||
loadingScreen(true);
|
||||
startService(new Intent(this, XMPPConnectionService.class));
|
||||
ServiceConnection connection = new ServiceConnection() {
|
||||
AppHelper.setServiceConnection(new ServiceConnection() {
|
||||
@Override
|
||||
public void onServiceConnected(ComponentName name, IBinder service) {
|
||||
XMPPConnectionService.XMPPServiceBinder binder = (XMPPConnectionService.XMPPServiceBinder) service;
|
||||
@ -151,9 +151,8 @@ public class LoginActivity extends AppCompatActivity implements CoreContracts.IL
|
||||
public void onServiceDisconnected(ComponentName name) {
|
||||
AppHelper.setXmppConnection(null);
|
||||
}
|
||||
};
|
||||
AppHelper.setServiceConnection(connection);
|
||||
bindService(new Intent(this, XMPPConnectionService.class), connection, Context.BIND_AUTO_CREATE);
|
||||
});
|
||||
bindService(new Intent(this, XMPPConnectionService.class), AppHelper.getServiceConnection(), Context.BIND_AUTO_CREATE);
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
|
Loading…
Reference in New Issue
Block a user