ServiceClientFragment: Connect early if possible

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Samuel Holland 2017-08-10 01:11:00 -05:00
parent 5fad89527d
commit dacd7457d2

View File

@ -21,6 +21,9 @@ abstract class ServiceClientFragment<T> extends Fragment implements ServiceConne
@SuppressWarnings("unchecked")
final ServiceConnectionProvider<T> localContext = (ServiceConnectionProvider<T>) context;
provider = localContext;
service = provider.getService();
if (service != null)
onServiceConnected(service);
}
@Override