没有合适的资源?快使用搜索试试~ 我知道了~
android403隐藏statusbar.doc
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 78 浏览量
2021-12-02
15:23:18
上传
评论
收藏 42KB DOC 举报
温馨提示
试读
14页
android403隐藏statusbar.doc
资源推荐
资源详情
资源评论
import android.content.IntentFilter; [java] view
plaincopy@Override public void onCreate() { // Pick
status bar or system bar. IWindowManager wm =
IWindowManager.Stub.asInterface( ServiceManager.
getService(Context.WINDOW_SERVICE)); try
{ SERVICES[0] = wm.canStatusBarHide()
R.string.config_statusBarComponent :
R.string.config_systemBarComponent; } catch
(RemoteException e) { Slog.w(TAG, "Failing checking
whether status bar can hide", e); } final int N =
SERVICES.length; mServices = new SystemUI[N];
for (int i=0; i<N; i++) { Class cl =
chooseClass(SERVICES[i]); Slog.d(TAG, "loading: " +
cl); try { mServices[i] =
(SystemUI)cl.newInstance(); } catch
(IllegalAccessException ex) { throw new
RuntimeException(ex); } catch (InstantiationException
ex) { throw new RuntimeException(ex); }
mServices[i].mContext = this; Slog.d(TAG, "running: "
学习文档 仅供参考
+ mServices[i]); mServices[i].start(); } //add
by xiaoge IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction(Intent.ACTION_DISPLAY_STATUS_B
AR);
intentFilter.addAction(Intent.ACTION_HIDE_STATUS_BAR);
registerReceiver(mStatusBarReceiver, intentFilter); }
//add by xiaoge BroadcastReceiver mStatusBarReceiver =
new BroadcastReceiver() { @Override public void
onReceive(Context context, Intent intent) { if (intent !=
null) { String action = intent.getAction();
final int N = SERVICES.length; for (int i = 0; i <
N; i++) { Slog.d(TAG, "invoke: " + mServices[i] +
"'s onReceive()"); mServices[i].onReceive(action);
} } } };
[java] view plaincopy//add by xiaoge
@SdkConstant(SdkConstantType.BROADCAST_INTENT_AC
TION) public static final String
ACTION_DISPLAY_STATUS_BAR =
"android.intent.action.DISPLAY_STATUS_BAR";
@SdkConstant(SdkConstantType.BROADCAST_INTENT_AC
TION) public static final String
学习文档 仅供参考
ACTION_HIDE_STATUS_BAR =
"android.intent.action.HIDE_STATUS_BAR"; //add ends
[java] view plaincopy/* * Copyright (C) 2010 The Android
Open Source Project * * Licensed under the Apache License,
Version 2.0 (the "License"); * you may not use this file except
in compliance with the License. * You may obtain a copy of the
License at * * :// apache.org/licenses/LICENSE-2.0 *
* Unless required by applicable law or agreed to in writing,
software * distributed under the License is distributed on an
"AS IS" BASIS, * WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied. *
See the License for the specific language governing permissions
and * limitations under the License. */ package
com.android.systemui.statusbar; import
com.android.systemui.statusbar.SeviceSocket; import
android.content.ComponentName; import
android.app.Notification; import
android.app.NotificationManager; import
android.app.PendingIntent; import java.io.File; import
java.io.FileReader; import java.util.Timer; import
java.util.TimerTask; import android.os.Handler; import
学习文档 仅供参考
剩余13页未读,继续阅读
资源评论
学习使人快乐张
- 粉丝: 14
- 资源: 6万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功