Codenameone Android BOOT_完整接收器在CN1上不工作

Codenameone Android BOOT_完整接收器在CN1上不工作,codenameone,Codenameone,我想知道这是不是CN1特有的东西,或者它是否与星系A6有关。我的直觉告诉我,这个接收器中的上下文和com.codename1.impl.android.AndroidNativeUtil.getActivity().getApplicationContext()中的上下文不一样 我正在添加以下内容 在android.permission.RECEIVE\u BOOT\u COMPLETEDbuild提示:true 在android.xapplicationbuild提示中: <receiv

我想知道这是不是CN1特有的东西,或者它是否与星系A6有关。我的直觉告诉我,这个接收器中的上下文和
com.codename1.impl.android.AndroidNativeUtil.getActivity().getApplicationContext()中的上下文不一样

我正在添加以下内容

android.permission.RECEIVE\u BOOT\u COMPLETED
build提示:
true

android.xapplication
build提示中:

<receiver android:name="com.groups.AutoStartReceiver">
<intent-filter>
    <action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
但是,当我在启动应用程序后读取文本文件的内容时,找不到该文件(FileNotFoundException)

我已经检查了单独写入文件的代码(当应用程序运行时),它正常工作。我知道我可以使用首选项,但我正在尽可能地保持它的本地性,以防操作系统在引导时不喜欢首选项等


如果需要,我可以共享我的整个清单文件

看来BOOT_COMPLETED已被弃用,不再工作。我在一些地方读过这篇文章,但没有任何地方是官方的

如果使用notifications包,则会隐式添加receive boot completed权限。我建议下载应用程序的Android本机源代码,并尝试使用Android Studio跟踪这些源代码,并登录本机代码。
package com.groups;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

public class AutoStartReceiver extends BroadcastReceiver 
{
@Override
public void onReceive(Context context, Intent arg1) 
{
    DataOutputStream os = null;
  try {
      os = new DataOutputStream(context.openFileOutput("testLogger", 0));
      os.writeUTF("onReceive called");
  } catch (Exception ex) {
  } finally {
      try {
          os.close();
      } catch (IOException ex) {
      }
  }
}
}