android


Intent BOOT_COMPLETED not working on Huawei device


I want to listen to APN Changes in my Android App.
Therefore I start a Service on android.intent.action.BOOT_COMPLETED.
This Service starts a ContentObserver which listens to changes to
content://telephony/carriers/preferapn.
I tested this setup on a few different devices (e.g. LG Spirit with Android 5.0, Samsung A3 with 6.0, Emulator Nexus5 with 7.0 and Huawei P9 Lite with 7.0)
On the Huawei phone onCreate of my Service is not called.
My other approach with android.intent.action.ANY_DATA_STATE in combination with a BroadcastReceiver which is registerd in the Manifest doesn't work either on this phone.
relevant parts of my manifest:
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
...
<receiver android:name=".ConnectivityChangeReceiver">
<intent-filter>
<action android:name="android.intent.action.ANY_DATA_STATE" />
</intent-filter>
</receiver>
<receiver android:name=".APNChangedServiceStarter" >
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.QUICKBOOT_POWERON" />
<action android:name="com.htc.intent.action.QUICKBOOT_POWERON"/>
</intent-filter>
</receiver>
<service android:name=".APNChangedService"></service>
Huawei Phones have a built-in startup manager, it could be that the app is not yet enabled.
Go to Settings > All, and choose Startup manager.
This program is used to manage startup apps on Android phone.
Allow or disallow app to run automatically after the Huawei phone starts up.

Related Links

Splash screen not relaunching when relaunching after Application memory collected
Parsing some array from json and some items in it in android
Connect Stripe using android and getting Stripe user id?
Get android device orientation even when autoRotation is turned off
Make a transparent Dialog in android
Android studio project cannot compile after adding facebook api
rem units don't work in webview
custom grid view in android example with data from backend
android gson listview populate
UnsatisfiedLinkError when init skmap on some devices
Position View X Y and translate animation to an Original location
Android How to set click listener of a button which is from another layout xml file
wxga android layout >600dp
Null pointer exception when setting values to TextView in Fragments
How to get image format? (not from file extension)
How can i use a tags input or editext for android

Categories

HOME
go
porting
awk
pagination
knitr
vscode-extensions
vsm
iis-6
nfs
pcl-crypto
xcodebuild
php-5.6
libc
comsol
mongodb-csharp
scsi
package.json
sencha-touch
microsoft-ocr
rubymotion
question2answer
highstock
definitelytyped
stackexchange
paperjs
cppreference
testcomplete
git-squash
classcastexception
carriage-return
pop3
imx6
getlasterror
docfx
salesforce-communities
openalpr
tex
amazon-ses
odroid
google-data-api
unordered-map
print-css
ssrs-2014
placeholder
knime
httr
optimizely
wpas
modelsim
edit
dt
css-transforms
janus
monkey
jtree
vibrate
winusb
seek
xcode-server
tooleap
android-dateutils
observablecollection
refinerycms
shopping
stream-processing
riot
cortex-m
beanstalk
iokit
intel-c++
dock
ocra
airbrake
apache-commons-daemon
exceldatareader
webmatrix-3
machine-instruction
imagefilter
lambda-architecture
template-deduction
mutual-authentication
dsym
square-bracket
xmltodict
code-duplication
mbunit
dtmf
hidapi
epiceditor
mantle
asplinkbutton
pdfviewer
pstack
fragmenttransaction
pyunit
hibernateexception
uipagecontrol
instantiationexception
murmurhash
skype4java
silverlight-oob
sun
appliance
great-circle

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile