huawei

BroadcastReceiver works for a while, then stops

扶醉桌前 提交于 2019-12-05 11:46:57
I'm developing an android app that responds to incoming calls. I've set up a broadcast receiver, set the permission and intent filter in the manifest file, and a lot of the time, it works. I can kill all apps, reboot the phone and it still works.. However, sometimes it doesn't react, and after this happens once, it doesn't respond after a reboot either. I've been struggling with this for about a month and it's driving me bananas. I really need my app to respond every time an incoming call is received. I've tried trimming out all code, and just displaying a Toast message when a call is received

Select dropdown Ionic don't show text

那年仲夏 提交于 2019-12-04 16:12:58
I am developing an application in Ionic 1.7. I have a select menu and I am facing a problem with it. For simplification, my code is like the documentation <label class="item item-input item-select"> <div class="input-label"> Lightsaber </div> <select> <option>Blue</option> <option selected>Green</option> <option>Red</option> </select> </label> http://ionicframework.com/docs/components/#select It works well with most devices, in iOS and Android. It shows the native select menu, and everything is OK. But I have a problem with one device, a Huawei MediaPad M2. Its my corporate tablet and this app

TelephonyManager.getDeviceId(0) returns different results

我只是一个虾纸丫 提交于 2019-12-04 05:30:20
问题 For some specific reasons I need to get the IMEI at some point in my Android app. Here is the code I use: TelephonyManager tm = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE); if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M){ // API available only >= 6.0 // Get first slot to avoid issue if we have multiple sim cards String imei = tm.getDeviceId(0); } else { String imei = tm.getDeviceId(); } It works fine in most cases. However some devices (like the

FileProvider error onHuawei devices

柔情痞子 提交于 2019-12-03 04:08:20
问题 I have an exception that happens only on Huawei devices in my app when using FileProvider.getUriForFile : Exception: java.lang.IllegalArgumentException: Failed to find configured root that contains /storage/<card name>/Android/data/<app package>/files/.export/2016-10-06 13-22-33.pdf at android.support.v4.content.FileProvider$SimplePathStrategy.getUriForFile(SourceFile:711) at android.support.v4.content.FileProvider.getUriForFile(SourceFile:400) Here is the definition of my file provider in my

FileProvider error onHuawei devices

巧了我就是萌 提交于 2019-12-02 17:27:50
I have an exception that happens only on Huawei devices in my app when using FileProvider.getUriForFile : Exception: java.lang.IllegalArgumentException: Failed to find configured root that contains /storage/<card name>/Android/data/<app package>/files/.export/2016-10-06 13-22-33.pdf at android.support.v4.content.FileProvider$SimplePathStrategy.getUriForFile(SourceFile:711) at android.support.v4.content.FileProvider.getUriForFile(SourceFile:400) Here is the definition of my file provider in my manifest: <provider android:name="android.support.v4.content.FileProvider" android:authorities="$

ACTION_IMAGE_CAPTURE returns imagefile as Extra instead of Data

点点圈 提交于 2019-12-02 11:16:07
问题 One feature of my app includes the camera. The user takes a picture and the app displays the image. I start an intent with ACTION_IMAGE_CAPTURE using StartActivityForResult and capture the response with onActivityResult. Usually I can simply call getData() on the intent I receive in onActivityResult and get the content uri for the MediaProvider. My problem is the following: One one of my test devices, a Huawei ALE-L21, the intent I get in onActivityResult has no data, but instead, it has a

ACTION_IMAGE_CAPTURE returns imagefile as Extra instead of Data

僤鯓⒐⒋嵵緔 提交于 2019-12-02 06:52:57
One feature of my app includes the camera. The user takes a picture and the app displays the image. I start an intent with ACTION_IMAGE_CAPTURE using StartActivityForResult and capture the response with onActivityResult. Usually I can simply call getData() on the intent I receive in onActivityResult and get the content uri for the MediaProvider. My problem is the following: One one of my test devices, a Huawei ALE-L21, the intent I get in onActivityResult has no data, but instead, it has a parcellable extra. How could I get the users photo from that? Android Studio doesn't tell me the name of

Android Kills Background Services in Xiaomi, Huawei etc

霸气de小男生 提交于 2019-12-02 06:50:28
问题 I need to make my service unstoppable. I tried to return START_STICKY on start command, it works well on emulator but, when remove the app from task manager on my device (Xiaomi mi5s, Android 7), it doesn't create itself again. @Override public int onStartCommand(Intent intent, int flags, int startId) { return START_STICKY; } Edit: I gave Auto Start permission and disabled battery protection rules for the app. Edit: Also I tried to use foreground service. However, it is being killed too..

Android Kills Background Services in Xiaomi, Huawei etc

馋奶兔 提交于 2019-12-02 06:46:43
I need to make my service unstoppable. I tried to return START_STICKY on start command, it works well on emulator but, when remove the app from task manager on my device (Xiaomi mi5s, Android 7), it doesn't create itself again. @Override public int onStartCommand(Intent intent, int flags, int startId) { return START_STICKY; } Edit: I gave Auto Start permission and disabled battery protection rules for the app. Edit: Also I tried to use foreground service. However, it is being killed too.. @Override public int onStartCommand(Intent intent, int flags, int startId) { super.onStartCommand(intent,

TelephonyManager.getDeviceId(0) returns different results

笑着哭i 提交于 2019-12-02 04:34:50
For some specific reasons I need to get the IMEI at some point in my Android app. Here is the code I use: TelephonyManager tm = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE); if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M){ // API available only >= 6.0 // Get first slot to avoid issue if we have multiple sim cards String imei = tm.getDeviceId(0); } else { String imei = tm.getDeviceId(); } It works fine in most cases. However some devices (like the Huawei Honor 7) offer dual-sim capability. In the settings, the user has the possibility to switch