android-reboot

Android using shared preference and Dispatcher activity, to get back to the last activity (after reboot the phone)

人走茶凉 提交于 2020-01-06 19:57:14
问题 I'm using a Shared Preferences to save the state of my application to be able to get to the last activity before my Android Handphone got re-boot-ed. My purpose is when Android system manage the memory and push out my apps, when users re-enter to the apps, they will get to the last Activity and screen of my apps. And this is some of my code : First is DispatcherActivity.java : > package com.lm.rosary; > > import android.app.Activity; import android.content.Intent; import > android.content

Boot BroadcastReceiver does not work on Xiaomi devices

不问归期 提交于 2019-12-28 04:06:34
问题 I have a following BroadcastReceiver which should run after boot completion. I have tested it on my Xiaomi device (Redmi 1s) , it's not running, while on other devices like Samsung it's running as expected. public class DeviceBootReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { if(intent.getAction().equals("android.intent.action.BOOT_COMPLETED")) { Toast.makeText(context, "I am Running", Toast.LENGTH_SHORT).show(); } } } I have set

Boot BroadcastReceiver does not work on Xiaomi devices

十年热恋 提交于 2019-12-28 04:06:28
问题 I have a following BroadcastReceiver which should run after boot completion. I have tested it on my Xiaomi device (Redmi 1s) , it's not running, while on other devices like Samsung it's running as expected. public class DeviceBootReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { if(intent.getAction().equals("android.intent.action.BOOT_COMPLETED")) { Toast.makeText(context, "I am Running", Toast.LENGTH_SHORT).show(); } } } I have set

Is the Application class guaranteed to be instantiated before a defined boot receiver is called

一世执手 提交于 2019-12-19 06:19:37
问题 Excuse me for such an elementary question. I understand that the Application class is instantiated when my app's process starts and I understand when the phone is completed booting my boot receiver will be called. I'm assuming since the phone knows via the manifest that my app holds BOOT_COMPLETED intent filter, the reboot process is. Phone reboots, phone starts all processes with BOOT_COMPLETED, phone fires off BOOT_COMPLETED broadcast. My concern came from wondering if I reference

Determine if phone has been rebooted

烈酒焚心 提交于 2019-12-02 04:56:18
问题 I'm trying to detect if an Android device has rebooted since the last time a preference value is set. Ideally, I'd like to do it without the android.permission.RECEIVE_BOOT_COMPLETED permission. One way I'm thinking about doing this is storing another preference value that contains some sort of session ID. When I update the preference value in question, I'd update the session value as well. When I check the value in the preference for the session value, if it equals the current session value

Determine if phone has been rebooted

梦想的初衷 提交于 2019-12-02 02:17:11
I'm trying to detect if an Android device has rebooted since the last time a preference value is set. Ideally, I'd like to do it without the android.permission.RECEIVE_BOOT_COMPLETED permission. One way I'm thinking about doing this is storing another preference value that contains some sort of session ID. When I update the preference value in question, I'd update the session value as well. When I check the value in the preference for the session value, if it equals the current session value then there has not been a reboot. If the current session value is different than what's saved, then

Is the Application class guaranteed to be instantiated before a defined boot receiver is called

我是研究僧i 提交于 2019-12-01 04:10:49
Excuse me for such an elementary question. I understand that the Application class is instantiated when my app's process starts and I understand when the phone is completed booting my boot receiver will be called. I'm assuming since the phone knows via the manifest that my app holds BOOT_COMPLETED intent filter, the reboot process is. Phone reboots, phone starts all processes with BOOT_COMPLETED, phone fires off BOOT_COMPLETED broadcast. My concern came from wondering if I reference Application class instance variables within my boot receiver if the receiver would ever get called before my

Alarmmanager not working after phone reboot

北城余情 提交于 2019-11-28 12:42:10
I had created alarmmanager on button click. but it not working after phone reboot. my AlarmbroadcastReceiver not call on phone reboot. it work when phone lock , application killed but not work after phone reboot i had created one progressbar which start on button click and stop after alarm broadcast fired but it not stop when phone reboot. i had added my button click event and broadcast receiver class Button click event b1.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { pb1.setVisibility(View.VISIBLE); progress_edit.putBoolean("progress_one", true);

Boot BroadcastReceiver does not work on Xiaomi devices

守給你的承諾、 提交于 2019-11-27 22:28:50
I have a following BroadcastReceiver which should run after boot completion. I have tested it on my Xiaomi device (Redmi 1s) , it's not running, while on other devices like Samsung it's running as expected. public class DeviceBootReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { if(intent.getAction().equals("android.intent.action.BOOT_COMPLETED")) { Toast.makeText(context, "I am Running", Toast.LENGTH_SHORT).show(); } } } I have set permission in Manifest. <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/> And