android-studio

Broadcast receiver working even after app is killed by user

纵然是瞬间 提交于 2021-02-18 15:30:11
问题 I have a BroadcastReceiver that checks for network connection declared statically as: <receiver android:name=".core.util.NetworkChangeReceiver" android:label="NetworkChangeReceiver"> <intent-filter> <action android:name="android.net.conn.CONNECTIVITY_CHANGE" /> <action android:name="android.net.wifi.WIFI_STATE_CHANGED" /> </intent-filter> </receiver> Network change receiver does something like: public class NetworkChangeReceiver extends BroadcastReceiver { @Override public void onReceive

App hang on install in Android Studio

六月ゝ 毕业季﹏ 提交于 2021-02-18 13:58:20
问题 Usually I build an app in Android Studio to test an app on Phone. But this occurs when I just click the Run app Waiting for device. Target device: motorola-nexus_6-ZX1G227B86 Uploading file local path: F:\HeadFirstAndroid\MateClient\app\build\outputs\apk\app-debug.apk remote path: /data/local/tmp/com.diyu.org.mateclient Installing com.diyu.org.mateclient DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/com.diyu.org.mateclient" It seems that the process is stuck on the pm install and no

Clean Project vs Rebuild Project vs Run Project in Android Studio

本小妞迷上赌 提交于 2021-02-18 12:33:05
问题 Does anyone have or know of a detailed answer to how these three functions in android studio work (I think Eclipse, and probably IntelliJ also, have the same or similar functions). I have seen and been told answers that give a brief outline of how they work and from what I understand a rebuild will also clean the project and running the project runs the last built version of the available code. Ultimately, I am just looking for an in depth explanation of how these three functions work with

Gradle dependencies for different api levels

吃可爱长大的小学妹 提交于 2021-02-18 11:26:08
问题 unfortunately I have to support Android 2.3, but I want to use a third party ui widget that has min-sdk 14 (Android 4.0). Is there a way to include the dependency with min-sdk 14? In code I would check Build.SDK_INT to determine whether to use the ui widget with min SDK 14 or a fallback UI widget. 回答1: It is not possible... If you have a dependency it is inside you compilation. inside your apk. You can choose if you want to use this third party lib with if(SDK_INT) but the lib will be

Gradle dependencies for different api levels

允我心安 提交于 2021-02-18 11:25:26
问题 unfortunately I have to support Android 2.3, but I want to use a third party ui widget that has min-sdk 14 (Android 4.0). Is there a way to include the dependency with min-sdk 14? In code I would check Build.SDK_INT to determine whether to use the ui widget with min SDK 14 or a fallback UI widget. 回答1: It is not possible... If you have a dependency it is inside you compilation. inside your apk. You can choose if you want to use this third party lib with if(SDK_INT) but the lib will be

Cannot open Android studio 4.2 Canary 8 or 9 after having installed Canary 7

柔情痞子 提交于 2021-02-18 11:05:42
问题 Context : macOs Catalina 10.15.6 Java 1.8.0_161 After having updated Android Studio 4.2 Canary 7 to Canary 8 (and to Canary 9), it cannot be opened any more. I've tried installing it from both Android Studio official website and from JetBrains' Toolbox app. In any case the same behavior occurs : When trying to launch Android Studio nothing happens. It doesn't even show the "SplashScreen" thing. When using command line to launch the app I have an error that may be useful : > open [...]/Android

Android Studio updates taking forever

天涯浪子 提交于 2021-02-18 10:35:14
问题 I'm seeing extremely slow installs of system image updates on my Android Studio 3.0 running on a macOS High Sierra system. What do I mean by "extremely slow"? Every system image update takes the better part of an hour. To my disgust, the latest set of updates (shown here from the component installer log) took over eight hours: To install: - Google APIs Intel x86 Atom System Image (system-images;android-24;google_apis;x86) - Google APIs Intel x86 Atom_64 System Image (system-images;android-25

Error of the emulator: “Unable to access 'C:\Users\…\.emulator_console_auth_token': emulator console will not work”, with username in Cyrillic

眉间皱痕 提交于 2021-02-18 08:45:50
问题 My username is written in Cyrillic which is why when I run the android studio emulator I get an error: Emulator: ERROR: Unable to access 'C:\Users\Александр.emulator_console_auth_token': emulator console will not work Is there any way to migrate the path to this file? 回答1: I solved the same problem with this video How to Rename the User’s Folder by changing Windows username to non Cyrillic . Same video in Russian language Как переименовать папку пользователя In my opinion, it is

How to fix “couldn't follow symbolic link” in Android Studio?

纵饮孤独 提交于 2021-02-18 06:13:42
问题 I'm now running an Android App project on Windows and running into the condition Error:Could not list contents of 'D:\source\App\src\main\res\drawable'. Couldn't follow symbolic link. after did the clean build. Android Studio states the drawable file is a broken symbolic link. I just check other related post online but still cannot figure out what does that mean, why is that happened, and how to fix it. Can anyone help to give me a clue to fix it? 回答1: Next time to save time you can run the

How to fix “couldn't follow symbolic link” in Android Studio?

寵の児 提交于 2021-02-18 06:13:30
问题 I'm now running an Android App project on Windows and running into the condition Error:Could not list contents of 'D:\source\App\src\main\res\drawable'. Couldn't follow symbolic link. after did the clean build. Android Studio states the drawable file is a broken symbolic link. I just check other related post online but still cannot figure out what does that mean, why is that happened, and how to fix it. Can anyone help to give me a clue to fix it? 回答1: Next time to save time you can run the