SolderingIronMen SolderingIronMen - 28 days ago 14
Android Question

Autostart (BOOT_COMPLETED) does not work on the Nomi tablet

My broadcast receiver triggered by event BOOT_COMPLETED and works fine on many devices except Nomi C10103.
The message appears in the log on the device:
D/ActivityManager: send broadcast: android.intent.action.BOOT_COMPLETED, skip package: com.example.myPackageName

Sending message am broadcast -a android.intent.action.BOOT_COMPLETED com.example.myPackageName from adb shell also does not run the application.

Manifest code:

<receiver
android:name=".AutoRunReceiver">
<intent-filter android:priority="1000">
<action android:name="android.intent.action.BOOT_COMPLETED" />
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<intent-filter android:priority="1000">
<action android:name="android.intent.action.QUICKBOOT_POWERON" />
</intent-filter>
</receiver>


AutorunReceiver.java:

public class AutoRunReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
//приёмник автозагрузки
if (intent != null && intent.getAction() != null) {
final String msg="intent:"+intent+" action:"+intent.getAction();
Log.d("myLogs",msg);
Toast.makeText(context,msg,Toast.LENGTH_LONG).show();
}
}
}

Answer

I realized that the problem is not in the code, but the device itself. Autoplay not working on my tablet for any application. As a workaround I have used the event "android.intent.action.USER_PRESENT", which is triggered after the device loading and screen unlocking.

Comments