Category "android"

Run Android instrumented tests fail

I tried to implement some unit and instrumented tests for my Android application (Java), my unit tests is working fine but instrumented tests are failing: @Run

How to identify multiple instances of Glance App Widget

I am trying to create a widget which shows information about a hardware device. There can be multiple of these devices and user will be able to add same widget

how to check if a phone number is valid whatsapp number in Android?

so I have an edit text that will be used as a view to get phone number from user, say if the phone number is +6123456789 , I want to check if this number has wh

No tests found for given includes Error, when running Parameterized Unit test in Android Studio

I have tried to run Parameterized Unit Tests in Android Studio, as shown below: import android.test.suitebuilder.annotation.SmallTest; import junit.framework

How to prevent touches prematurely stopping smoothScroll in RecyclerView?

I am using an Adapter to fill a RecyclerView with numerous CardView layouts (horizontally). Each CardView has a Button at the bottom of the layout, which when p

Left and top padding for CheckBox doesn't work

I want to create layout for Custom Adapter. It should be line with checkbox, icon and textView. I use next layout xml configuration for row: <LinearLayout

Dynamic link seems to not survive to the installation process

My MainActivity manages the deep link this way override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) ... intent?.l

Changing an ImageView to black and white

I would like to change an ImageView's image to black and white. The only thing is my code allows the user to take a photo, that photo is placed in the imageview

Mapbox: How to correct Line overlapping over a Symbol

I'm using the SymbolManager to display two symbols on the map. Here is an example: The dark symbol is because of the fact that I'm testing the project on the

Android SearchView.OnQueryTextListener OnQueryTextSubmit not fired on empty query string

I am using Android 4.1.2. I have a SearchView widget on an ActionBar. Documentation on SearchView.OnQueryTextListener from the android developer site states tha

how to play audio file in android from internal memory of phone

I want to make sample to play an audio file in android ,i want to play music from internal memory of phone .how to give path please suggest. I am writing this,

How to avoid partial coverage with lateinit fields in Kotlin

I have an Android service written in Kotlin which I inject using Guice. It has lateinit fields which cannot be null, but they must be lateinit because I cannot

JaCoCo returning 0% Coverage with Kotlin and Android 3.0

I am trying to check my code coverage for a test case that I wrote in Kotlin. When I execute ./gradlew createDebugCoverageReport --info, my coverage.ec file is

Android Studio access MYSQL with JDBC

I've been trying to connect to MYSQL by using of JDBC for a while now but having no luck. I have my database set up already with some information inside and I'

Google Identity One-Tap Sign-In Exception: Caller has been temporarily blacklisted due to too many canceled sign-in prompts

I am currently working on migration to One-Tap Sign-In, and after I tried few times on the device, my device gets blacklisted with exception (Caller has been te

"The following SDK components were not installed: sys-img-x86-addon-google_apis-google-22 and addon-google_apis-google-22"

I'm Windows 7 64-bit user and I got Android Studio problem after I update the latest version of Android Studio and SDK components.. The following SDK component

First run of Android Studio. Unable to access Android SDK add-on list

After trying to reinstall Android Studio, everything was fine until the first run. While it was 'fetching Android SDK component information', it gave me an er

Using facebook SDK on Android gives "User logged in as different Facebook user." error

I'm upgrading my use of the Facebook SDK to the latest version. The following code is prety much lifted line by line from Facebook's own examples, which can be

React Native on Android: Cannot run program "node": error=2, No such file or directory

EDIT: I am uncertain which steps I took to resolve this problem, and am no longer seeing this error message so I cannot test the solutions below. Please try the

How do I stop Android Studio from highlighting specific words when double clicking?

Whenever I double click on whatever contains more than one word in it, Android Studio will highlight the word it thinks I'm clicking on rather than that entire