What is the broadcast I should send that the following listener will get:
package com.android.settings;
import android.app.Activity;
import android.content.Intent;
import android.content.IntentFilter;
import com.android.internal.statusbar.IStatusBarService;
import android.os.ServiceManager;
import android.util.Log;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.os.RemoteException;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceManager;
public class ShowStatusBarReceiver extends BroadcastReceiver
{
private static final String TAG = "ShowStatusBarReceiver";
final Object mServiceAquireLock = new Object();
IStatusBarService mStatusBarService;
@override
public void onReceive(Context context, Intent intent)
{
Bundle bundle = intent.getExtras();
boolean isShow = intent.getBooleanExtra("show",false);
if(!isShow){
enShowStatusBar(true);
}else{
enShowStatusBar(false);
}
if(bundle != null) {
String hideNav = bundle.getString("show");
String defStr = "true";
if (defStr.equals(hideNav)) {
enShowStatusBar(false);
}
}
}
IStatusBarService getStatusBarService() {
synchronized (mServiceAquireLock) {
if (mStatusBarService == null) {
mStatusBarService = IStatusBarService.Stub.asInterface(
ServiceManager.getService("statusbar"));
}
return mStatusBarService;
}
}
package com.android.settings;
import android.app.Activity;
import android.content.Intent;
import android.content.IntentFilter;
import com.android.internal.statusbar.IStatusBarService;
import android.os.ServiceManager;
import android.util.Log;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.os.RemoteException;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceManager;
public class ShowStatusBarReceiver extends BroadcastReceiver
{
private static final String TAG = "ShowStatusBarReceiver";
final Object mServiceAquireLock = new Object();
IStatusBarService mStatusBarService;
@override
public void onReceive(Context context, Intent intent)
{
Bundle bundle = intent.getExtras();
boolean isShow = intent.getBooleanExtra("show",false);
if(!isShow){
enShowStatusBar(true);
}else{
enShowStatusBar(false);
}
if(bundle != null) {
String hideNav = bundle.getString("show");
String defStr = "true";
if (defStr.equals(hideNav)) {
enShowStatusBar(false);
}
}
}
IStatusBarService getStatusBarService() {
synchronized (mServiceAquireLock) {
if (mStatusBarService == null) {
mStatusBarService = IStatusBarService.Stub.asInterface(
ServiceManager.getService("statusbar"));
}
return mStatusBarService;
}
}