我一直试图在我的应用程序上实施备份超过一个月,但直到现在都没有成功.我已经完成了Google文档通知的所有步骤:在Manifest上的Google Service Changes上注册(allowBackup,backupAgent和backup.api_key(google服务注册)等等...
清单部分:
<application
android:allowBackup="true"
android:backupAgent="my.package.MyBackupManagerClass">
<meta-data android:name="com.google.android.backup.api_key"
android:value="my-generated-key-by-google-service" />
Run Code Online (Sandbox Code Playgroud)
事实上,备份正在运行,但只使用本地传输,我已经使用bmgr备份/运行/恢复进行了测试:
bmgr list transports
* android/com.android.internal.backup.LocalTransport
com.google.android.gms/.backup.BackupTransportService
Run Code Online (Sandbox Code Playgroud)
但是,在尝试使用谷歌时的运输(云:com.google.android.gms/.backup.BackupTransportService)它没有工作,甚至没有叫我onCreate()的MyBackupAgentHelper.
我要提到的一点是,当我运行时:bmgr backup bmgr run
在运行命令之后,在logcat上显示了很多"现在暂存备份"(也显示我的应用程序包在此列表中)但它发生得非常快并且看起来事实上并没有完成备份,毕竟,甚至我的MyBackupHelper.onCreate()未被调用:
02-12 21:13:28.889: D/BackupManagerService(547): Now staging backup of com.google.android.talk
02-12 21:13:28.904: D/BackupManagerService(547): Now staging backup of com.google.android.dialer
02-12 21:13:28.907: D/BackupManagerService(547): Now staging backup of com.android.providers.settings
02-12 21:13:28.910: D/BackupManagerService(547): Now staging backup of com.sirma.mobile.bible.android
02-12 21:13:28.914: D/BackupManagerService(547): Now staging backup of com.android.sharedstoragebackup
02-12 21:13:28.919: D/BackupManagerService(547): Now staging backup of …Run Code Online (Sandbox Code Playgroud) 我正在开发Lollipop新闻之前的应用程序,然后我正在使用ActionBar,Tabs(查看寻呼机)和导航抽屉.
随着棒棒糖的变化,ActionBar不再存在,从现在起我的应用程序应该更改什么?
谢谢!
将通知频道设置为在锁屏不显示通知后,它仍然在锁屏上显示通知。
notificationChannel.setLockscreenVisibility(Notification.VISIBILITY_SECRET);
notificationManager.createNotificationChannel(notificationChannel);
Run Code Online (Sandbox Code Playgroud)
但是在创建频道后我可以调试它,看到通知频道没有将lockScreenVisibility设置为VISIBILITY_SECRET(-1),它仍然具有默认值,即-1000。
notificationChannel.getLockscreenVisibility()
Run Code Online (Sandbox Code Playgroud)
有谁知道如何设置锁屏可见性不显示在锁屏上?或者知道为什么它没有被更新?
还有一个信息是我之前已经创建了频道。但是我已经使用 VISIBILITY_SECRET 删除并重新创建了频道。
notifications android android-notifications notification-channel
我的问题仅发生在已发布的 apk 上。通过 Android Studio 安装的应用程序运行时没有任何错误。但是通过 Google Play 安装的程序错误地使用 GSON 库生成了我的 JSON 文件,似乎它没有在发布的 apk 上使用我的 JSONEntity。
正确:使用 Android Studio 在我的应用程序上生成的文件:
{
"categories": [
{
"_id": 1,
"name": "General"
},
....
Run Code Online (Sandbox Code Playgroud)
错误:通过从 Google Play 下载应用程序生成:
{
"a": [
{
"a": 1,
"b": "General"
}
],
...
Run Code Online (Sandbox Code Playgroud)
知道为什么这种情况只发生在 Google Play 上发布的应用程序上吗?