bootcompleted

Android ACTION_SHUTDOWN Broadcast not working

女生的网名这么多〃 提交于 2019-12-17 06:14:30
问题 Code - public class ShutdownReceiver extends BroadcastReceiver { private static final String TAG = "ShutdownReceiver"; @Override public void onReceive(final Context context, final Intent intent) { Logger.i(TAG, "Shutting Down.........................."); if("android.intent.action.ACTION_SHUTDOWN".equals(intent.getAction())) { //Power Off } } } Service - private BroadcastReceiver mReceiver = null; @Override public void onCreate() { super.onCreate(); // INITIALIZE RECEIVER //It is used to

Android BOOT_COMPLETED not received when application is closed

我与影子孤独终老i 提交于 2019-12-17 02:35:12
问题 I am aware that this question has been asked a lot on the site, however, I cant seem to find a solution. My BOOT_COMPLETED receiver is not called when the application is not running. Manifest: <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.startuptest" android:versionCode="1" android:versionName="1.0" android:installLocation="internalOnly"> <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> <uses-sdk android:minSdkVersion="8

Android -Starting Service at Boot Time

十年热恋 提交于 2019-12-16 20:02:28
问题 I need to start a service at boot time. I searched a lot. They are talking about Broadcastreceiver. As I am new to android development, I didn't get a clear picture about services on Android. Please provide some source code. 回答1: Create a BroadcastReceiver and register it to receive ACTION_BOOT_COMPLETED. You also need RECEIVE_BOOT_COMPLETED permission. Read: Listening For and Broadcasting Global Messages, and Setting Alarms 回答2: Your receiver: public class MyReceiver extends

Android BroadcastReceiver on BOOT_COMPLETED does not start alarm

为君一笑 提交于 2019-12-13 14:09:52
问题 I'm trying to use a relatively simple solution to execute some code on boot. Basically I want to schedule/reschedule an Alarm at boot to execute a certain task in the future. In my manifest I have: <uses-permission android:name="com.android.alarm.permission.SET_ALARM"/> <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> <receiver android:name="com.cswt.lcyairport.alarm.AlarmReceiver"> <intent-filter> <action android:name="android.intent.action.BOOT_COMPLETED"/> <

How to create a notification that always run even after phone reboot?

不打扰是莪最后的温柔 提交于 2019-12-13 10:23:17
问题 I have set an alarm manager at a method setAlarm() at MainActivity that contain a date from firebase database and set an alarm based on that. This is pretty good when I try to run this. But when I try to reboot my phone before the alarm times up, nothing have been happened. I also have tried to create a Receiver that refer to a service. And from this service onHandleIntent(Intent intent) , I call MainActivity.setAlarm() . Also i have been added a permission boot complete at android manifest.

Cannot start an external service from a boot_complete receiver

我的梦境 提交于 2019-12-11 16:10:01
问题 I'm trying to start an external service from my apk using as little code as necessary. Testing the package on a 4.0 AVD and verifying the response in logcat seems to give proper results; however, on the actual device it doesn't load. Actually, it doesn't even seem to be listed at all in logcat. It is probably something that I'm overlooking and just need a second pair of eyes to confirm. StartService.java: package com.winca.service.start; import android.content.BroadcastReceiver; import

Getting ResourceNotFoundException after device rebooted

最后都变了- 提交于 2019-12-11 02:35:36
问题 I am having Boot Completed Receiver in my application and after Reboot completed, inside my Boot Receiver I am starting an Activity. In that I am getting ResourceNotFoundException on setting layout. setContentView(R.layout.activity_home);//getting error of resource not found on this line I don't know the reason but its but obviously because it is not able to find the layout or R in my app. Anyone has any idea about this? Please kindly guide me to resolve this issue. EDIT - I found that if I

Autostart (BOOT_COMPLETED) does not work on the Nomi tablet

独自空忆成欢 提交于 2019-12-08 03:22:17
问题 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

BroadcastReceiver for BOOT_COMPLETED is too slow

人走茶凉 提交于 2019-12-06 02:04:17
问题 The below is my manifest file. <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.mccheekati.test_trail"> <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme"> <receiver android:name

Android 2.2: How to make an app to run automaticly on startup & how to make an app start another app

与世无争的帅哥 提交于 2019-12-04 11:19:48
The topic pretty much says it all. Use BroadcastReceiver that receives Intent of action BOOT_COMPLETED . in onReceive() method create an Intent for your activity: @Override public void onReceive(Context context, Intent intent) { Intent myIntent = new Intent(context, YourActivity.class); context.startActivity(myIntent); } Mathias Conradt For the application on startup, you need to add the permission <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/> to your manifest. Then do as Vladimir wrote. For starting another app, you need to know the (hopefully official) intent to