小编Vad*_*dik的帖子

如何使用 android:dataExtractionRules 指定不允许任何数据备份?

我当前的 Android 应用程序目标为 12 及更高版本。

我不想允许任何类型的备份,并且当前有以下清单设置:

android:allowBackup="false"
android:fullBackupContent="false"
Run Code Online (Sandbox Code Playgroud)

但是,该android:allowBackup="false"设置现在会发出以下警告:

android:allowBackup 属性已从 Android 12 及更高版本中弃用,并且可能会在未来版本中删除。考虑添加属性 android:dataExtractionRules 指定 @xml 资源,该资源在 Android 12 及更高版本上配置云备份和设备传输。

我查看了 xml 的示例android:dataExtractionRules,但没有一个显示如何配置allowBackup="false".

我缺少什么?

是否可以allowBackup="false"使用 android:dataExtractionRulesxml来实现?

android android-manifest

77
推荐指数
2
解决办法
2万
查看次数

github-actions[bot] 的权限被拒绝。请求的 URL 返回错误:403

我想使用 Github Actions 将文件推送到当前存储库。

我已经写了一个使用官方actions/checkout@v3操作的基本配置。我的配置与自述文件示例中几乎相同:

name: Example
on: workflow_dispatch
jobs:
  example:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - shell: bash
        run: |
          date > 1.txt
          git config user.name github-actions
          git config user.email github-actions@github.com
          git add 1.txt
          git commit -m updated
          git push
Run Code Online (Sandbox Code Playgroud)

此配置适用于除 Github Pages 存储库之外的任何存储库。错误是:

remote: Permission to sirekanian/sirekanian.github.io.git denied to github-actions[bot].
fatal: unable to access 'https://github.com/sirekanian/sirekanian.github.io/': The requested URL returned error: 403
Error: Process completed with exit code 128.
Run Code Online (Sandbox Code Playgroud)

为什么 GitHub Pages 存储库与普通存储库不同?GitHub Pages …

git-push github-pages github-actions

28
推荐指数
2
解决办法
1万
查看次数

为什么map在Haskell中使用范围时会返回一个额外的元素?

我刚开始学习Haskell并发现了一件奇怪的事情.

我们有一个清单:

ghci> [0,2..5]
[0,2,4]
Run Code Online (Sandbox Code Playgroud)

它有3个元素.当我使用map这个列表时,我得到3个元素作为输出,例如:

ghci> map (+ 1) [0,2..5]
[1,3,5]
ghci> map (* 2) [0,2..5]
[0,4,8]
ghci> map (`div` 2) [0,2..5]
[0,1,2]
Run Code Online (Sandbox Code Playgroud)

但是当我使用小数除法时,我在输出列表中得到4个元素:

ghci> map (/ 2) [0,2..5]
[0.0,1.0,2.0,3.0]
ghci> length (map (/ 2) [0,2..5])
4
Run Code Online (Sandbox Code Playgroud)

你能否解释为什么map可能会返回更多的元素呢?

谢谢!

haskell range division

8
推荐指数
1
解决办法
119
查看次数

安卓撰写。尝试运行基本代码时出错

我开始使用 Android Jetpack Compose。我安装了 Canary,当我创建一个 Empty Compose Activity 并在没有更改的情况下运行它时(你好 Android!)我有下一个错误:

    Process: com.example.jetpacktest2, PID: 24788
    java.lang.AbstractMethodError: abstract method "void androidx.lifecycle.DefaultLifecycleObserver.onCreate(androidx.lifecycle.LifecycleOwner)"
        at androidx.lifecycle.FullLifecycleObserverAdapter.onStateChanged(FullLifecycleObserverAdapter.java:36)
        at androidx.lifecycle.LifecycleRegistry$ObserverWithState.dispatchEvent(LifecycleRegistry.java:354)
        at androidx.lifecycle.LifecycleRegistry.addObserver(LifecycleRegistry.java:196)
        at androidx.compose.ui.platform.AndroidComposeView.onAttachedToWindow(AndroidComposeView.android.kt:808)
        at android.view.View.dispatchAttachedToWindow(View.java:19855)
        at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3597)
        at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3604)
        at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3604)
        at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3604)
        at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3604)
        at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2376)
        at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1993)
        at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8459)
        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1256)
        at android.view.Choreographer.doCallbacks(Choreographer.java:995)
        at android.view.Choreographer.doFrame(Choreographer.java:887)
        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1224)
        at android.os.Handler.handleCallback(Handler.java:900)
        at android.os.Handler.dispatchMessage(Handler.java:103)
        at android.os.Looper.loop(Looper.java:219)
        at android.app.ActivityThread.main(ActivityThread.java:8387)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1055)
Run Code Online (Sandbox Code Playgroud)

我没有修改任何东西,它是Android创建的基本代码。任何帮助表示赞赏。

PS:我加载了在 Android Studio 上制作的其他代码(没有编写)并且它运行没有错误。

android kotlin android-jetpack-compose

5
推荐指数
1
解决办法
572
查看次数

删除我模型的 ArrayList 中的重复项

如果我想说实话,我不知道 android 或 java 中的任何集合的工作,但是我的问题和我的目的,我想删除我的模型或我的类的 ArrayList 中的重复项,这是我的模型,如下所示:

public class PersonClass {

    private String ID;
    private String Name;
    private String Family;
    private String Nickname;
    private String Email;
    private String Mobile;
    private Date BirthDate;
    private boolean Admin;
    private boolean Gender;
    private String ThumbnailURL;

    public PersonClass() {
    }

    public PersonClass(String ID, String name, String family, String nickname, String email, String mobile, Date birthDate, boolean admin, boolean gender, String thumbnailURL) {
        this.ID = ID;
        Name = name;
        Family = family;
        Nickname = nickname;
        Email …
Run Code Online (Sandbox Code Playgroud)

collections android model class duplicates

1
推荐指数
1
解决办法
3074
查看次数