我希望我的应用能够打开屏幕并显示我的应用程序.假设我正在设置闹钟,每小时我都希望我的应用在设备自然睡眠前显示2分钟.
我看到不推荐使用WakeLock(FULL_LOCK)和KeyguardManager.
我创建了一个WakefulBroadcastReceiver和服务,这些都在工作.
@Override
protected void onHandleIntent(Intent intent) {
// I need to show the screen here!
for (int i=0; i<5; i++) {
Log.i("SimpleWakefulReceiver", "Running service " + (i + 1)
+ "/5 @ " + SystemClock.elapsedRealtime());
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
}
}
Log.i("SimpleWakefulReceiver", "Completed service @ " +
SystemClock.elapsedRealtime());
SimpleWakefulReceiver.completeWakefulIntent(intent);
}
Run Code Online (Sandbox Code Playgroud)
如何以编程方式打开屏幕,过去锁定并从IntentService显示我的活动?
谢谢
在我的 Android 应用中实现的 Google Smart Lock 功能。我正在尝试将密码黑白同步我的网站和我的 Android 应用程序。
根据本文件:https : //developers.google.com/identity/smartlock-passwords/android/associate-apps-and-sites
我已经完成了所有需要的更改。
我的网站网址是https: //auth-test. Centurylink.com
数字资产链接文件上传至服务器链接:https : //auth-test. Centurylink.com/.well-known/assetlinks.json
在清单中,我添加了以下代码。
<meta-data android:name="asset_statements" android:resource="@string/asset_statements" />
在 String.xml 中
<string name="asset_statements" translatable="false">[{\"include\": \"https://auth-test.centurylink.com/.well-known/assetlinks.json\"</string>
应用程序已发布到 Beta 版的 Play-store,2 周前。还多次提交了网站/应用程序凭据链接表,
仍然没有收到任何确认邮件,也没有收到任何错误。
解决问题或与团队沟通的最佳方式是什么?网页和应用同步密码需要多长时间?
android google-chrome google-smartlockpasswords google-identity
我已经将默认应用程序定义为具有HOME意图的启动器,因此它在我启动设备时始终运行.但是当我打开电源时,我仍然会看到默认锁定屏幕(带时钟).
有没有办法在设备启动时完全取下锁屏?