use of com.bel.android.dspmanager.service.HeadsetService in project android_packages_apps_DSPManager by CyanogenMod.
the class MyAdapter method onResume.
@Override
public void onResume() {
super.onResume();
ServiceConnection connection = new ServiceConnection() {
@Override
public void onServiceConnected(ComponentName name, IBinder binder) {
HeadsetService service = ((HeadsetService.LocalBinder) binder).getService();
String routing = service.getAudioOutputRouting();
String[] entries = pagerAdapter.getEntries();
for (int i = 0; i < entries.length; i++) {
if (routing.equals(entries[i])) {
viewPager.setCurrentItem(i);
break;
}
}
unbindService(this);
}
@Override
public void onServiceDisconnected(ComponentName name) {
}
};
Intent serviceIntent = new Intent(this, HeadsetService.class);
bindService(serviceIntent, connection, 0);
}
Aggregations