android-studio

Android Broadcast Receiver is not working in background

烂漫一生 提交于 2020-05-14 07:42:13
问题 I have 2 Android mobile cellphones with different Android versions. The first cellphone is running Kitkat and the second one Nougat. I'm currently using the following code. After 5 or 7 hours the android application is not detecting events anymore. Can someone please help me out? package com.doct.patients.Broadcast; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.widget.Toast; public class smsReceiver extends

Android Broadcast Receiver is not working in background

心不动则不痛 提交于 2020-05-14 07:40:08
问题 I have 2 Android mobile cellphones with different Android versions. The first cellphone is running Kitkat and the second one Nougat. I'm currently using the following code. After 5 or 7 hours the android application is not detecting events anymore. Can someone please help me out? package com.doct.patients.Broadcast; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.widget.Toast; public class smsReceiver extends

Android Studio: keyboard shortcut to show the error on the current line?

徘徊边缘 提交于 2020-05-14 07:19:13
问题 The only way I have found to show the error of an underlined piece of code is to hover it with the mouse. What is the keyboard shortcut to achieve this? (when the cursor is on the line in error) 回答1: On Mac that's Command-F1 (in the menu bar it's View -> Error Description). I think that's Control-F1 on Windows. 回答2: You should try using Alt+Enter key. This will recommend you the available solution for your error. Also try using Ctrl+F1 it will give you a detailed information for your error. P

Blurry Launcher Icons

醉酒当歌 提交于 2020-05-13 07:04:11
问题 I am trying to add a launcher icon to my Android application, but something seems wrong with resolution whan app is installed. The device I'm working with has an XHDPI screen, so I am testing with a 96x96 (px) image. I used the Image Asset in Android Studio to generate a default icon: This is the result in my device: You can notice that the image is a bit blurry, as it has been resized. It happens with every icon I make. What is happening? I am using MIUI, altough it doesn't appears to affect

React-native (Signed) release apk keeps crashing in device

南笙酒味 提交于 2020-05-13 07:01:57
问题 I created a signed react-native apk after following all the documents from the official react native documentation ( i.e. https://facebook.github.io/react-native/docs/signed-apk-android ). After creating it my app crashed. Taking a step back, I decided to make a new un-edited app and redo the same steps. However, the app still crashed. I looked at all the discussions at StackOverflow and tried their solution but none worked. Can anyone tell me what I did wrong? And how I can solve it. Here is

ANTLR Tool version 4.5.3 used for code generation does not match the current runtime version 4.7.1

僤鯓⒐⒋嵵緔 提交于 2020-05-13 06:12:50
问题 I'm getting an error in DataBindingMapperImpl.java for one specific data binding which results in the following error when building the project. ANTLR Tool version 4.5.3 used for code generation does not match the current runtime version 4.7.1ANTLR Runtime version 4.5.3 used for parser compilation does not match the current runtime version 4.7.1ANTLR Tool version 4.5.3 used for code generation does not match the current runtime version 4.7.1ANTLR Runtime version 4.5.3 used for parser

Error: Failed to find target with hash string 'android-28'

走远了吗. 提交于 2020-05-13 04:18:43
问题 When I sync my project in build.gradle(Project: Allo) I see this error Failed to find target with hash string 'android-28'in: C:\Users\hacker\AppData\Local\Android\Sdk Config: apply plugin: 'com.google.gms.google-services' android { compileSdkVersion 28 defaultConfig { applicationId "com.example.android.allo" minSdkVersion 19 targetSdkVersion 28 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled

How to increase Microphone volume level in Android PJSIP?

会有一股神秘感。 提交于 2020-05-12 15:53:47
问题 I have Integrated PJSIP with android . While making call in my application, the Speaker is working perfectly but Recording microphone volume is too low . My voice is not hearable by other side. Note: But in some mobiles it's working properly. Even i tried with adjustStreamVolume(), setStreamVolume(), setMode(),adjustVolume() methods to increase my volume level, it doesn't increase in anyway. Please give me a suggestion to solve this problem to increasing microphone Volume level in Android or

Can not remove generated DataBinding code

本小妞迷上赌 提交于 2020-05-12 11:57:26
问题 I used DataBinding in one of my classes CardRecicleViewAdapterTech.class , but I imported a library which does not support DataBinding and I switched to butter knife for that class. The problem is that when I run the project, Android Studio always generates a class binding related with CardRecicleViewAdapterTech.class and this causes a crash. The generated class is: CardViewTechBinding.java I have deleted that java file in Android Studio databinding folder, but its generated again and again

Gradle - Could not get unknown property 'scm' for configuration container

£可爱£侵袭症+ 提交于 2020-05-12 09:02:03
问题 Execution failed for task ':app:iterateDeclaredDependencies'. > Could not get unknown property 'scm' for configuration container of type org.gradle.api.internal.artifacts.configurations.DefaultConfigurationContainer. I'm using the exact code snippet from Working with Dependencies I don't know what scm is here but autocompletion seems to suggests that all is good, no? Versions I'm using: ------------------------------------------------------------ Gradle 5.4.1 ---------------------------------