private HomeKeyReceiver mHomeKeyReceiver;
mHomeKeyReceiver = new HomeKeyReceiver();
private class HomeKeyReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if (action.equals(Intent.ACTION_CLOSE_SYSTEM_DIALOGS)) {
String reason = intent.getStringExtra("reason");
if (TextUtils.equals(reason, "homekey")) {
if (lsp_live_player != null) {
lsp_live_player.stopLiveForHomeKey();
}
}
}
}
};
@Override
public void onResume() {
super.onResume();
getActivity().registerReceiver(mHomeKeyReceiver, new IntentFilter(Intent.ACTION_CLOSE_SYSTEM_DIALOGS));
}
@Override
public void onPause() {
super.onPause();
getActivity().unregisterReceiver(mHomeKeyReceiver);
}