Skip to content

Commit 5f0b2a8

Browse files
fix: android auto service binding fix (#360)
1 parent e3cd86a commit 5f0b2a8

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

example/android/app/src/main/java/com/sampleapp/SampleAndroidAutoSession.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,18 @@ public SampleAndroidAutoSession(SessionInfo sessionInfo) {
4949
@Override
5050
public void onCreate(@NonNull LifecycleOwner lifecycleOwner) {
5151
Log.i(TAG, "In onCreate()");
52-
}
53-
54-
@Override
55-
public void onStart(@NonNull LifecycleOwner lifecycleOwner) {
56-
Log.i(TAG, "In onStart()");
5752
getCarContext()
5853
.bindService(
5954
new Intent(getCarContext(), SampleAndroidAutoService.class),
6055
mServiceConnection,
6156
Context.BIND_AUTO_CREATE);
6257
}
6358

59+
@Override
60+
public void onStart(@NonNull LifecycleOwner lifecycleOwner) {
61+
Log.i(TAG, "In onStart()");
62+
}
63+
6464
@Override
6565
public void onResume(@NonNull LifecycleOwner lifecycleOwner) {
6666
Log.i(TAG, "In onResume()");
@@ -74,12 +74,12 @@ public void onPause(@NonNull LifecycleOwner lifecycleOwner) {
7474
@Override
7575
public void onStop(@NonNull LifecycleOwner lifecycleOwner) {
7676
Log.i(TAG, "In onStop()");
77-
getCarContext().unbindService(mServiceConnection);
7877
}
7978

8079
@Override
8180
public void onDestroy(@NonNull LifecycleOwner lifecycleOwner) {
8281
Log.i(TAG, "In onDestroy()");
82+
getCarContext().unbindService(mServiceConnection);
8383
}
8484
};
8585

0 commit comments

Comments
 (0)