android-studio

Android studio Java update text in the loop

青春壹個敷衍的年華 提交于 2020-01-11 09:43:46
问题 first time learning coding language here.. I am struggling in many parts of Java, but I am slowly learning. I was making an app and had to show dynamically updating text. So the below code is my attempt, it works very well (sort of). The problem is that it does not update the screen while program is running the for loop. So when I press a button from main activity, it runs an activity called play. It has 14 text fields of 0, and should update them to 7 one by one automatically. But after

Handle onMessageReceived() and onTokenRefresh() even if the app is not running

微笑、不失礼 提交于 2020-01-11 09:21:55
问题 I have an app with 2 services : MessagingService extends FirebaseMessagingService and InstanceIDService extends FirebaseInstanceIdService There are declared in the AndroidManifest.xml file. The problem is that when my app's process is forced close itself, the services are also killed. I'd like them not to be killed. I've heard about the START_STICKY flag for the Service class, but I can't override the onStartCommand() method in these services so as to return this flag... 回答1: To answer to the

Can't install Intel HAXM for Android Studio. ERROR x86 emulation currently requires hardware acceleration

我的梦境 提交于 2020-01-11 09:18:09
问题 I just installed Android Studio without any problems. But when I run the emulator, I get an error: Cannot Launch AVD in emulator. Output: emulator emulator: ERROR: x86 emulation currently requires hardware acceleration! Please ensure Intel HAXM is properly installed and usable. CPU acceleration status: HAX kernel module is not installed! I have found a lot of similar posts and I have tried a few things but nothing has worked so far so I decided to make a post. What I've tried: Install HAXM

Android Studio runtime error Stub! at com.amazon.device.messaging.ADMMessageReceiver.<init>()

独自空忆成欢 提交于 2020-01-11 08:52:07
问题 When I build the Amazon (Kindle) flavor of my Android app I run into this Runtime error: Caused by: java.lang.RuntimeException: Stub! at com.amazon.device.messaging.ADMMessageReceiver.<init>() I need the local amazon-device-messaging.jar file to compile my app, however I do not need to include it during runtime as the amazon device will have the necessary classes and methods. How do I update my Android Studio build.gradle file to do this? 回答1: I also ran into this issue. When adding the

java.lang.ClassNotFoundException: Didn't find class on path: DexPathList , After updating sdk

◇◆丶佛笑我妖孽 提交于 2020-01-11 08:31:28
问题 Hello guys My application was all working fine till yesterday, i updated my SDK yesterday and it started giving error first it gave an error No resource found at values v24 .... some thing like this i searched and solved it by changing following lines in build.gradle compileSdkVersion 25 buildToolsVersion '25.0.2' now that error is gone and It is running completely fine in higher android version 7.1.1 but when i run in lower version of android it is giving following error E/AndroidRuntime:

Android Studio's device chooser is shown before Gradle Build completes

好久不见. 提交于 2020-01-11 08:27:10
问题 Prior to Android Studio 1.5, the device chooser was shown upon Gradle Build completion. This allowed to use build time to physically configure devices, make any last minute changes or to ensure that devices were actually connected at the time of install. I also disconnected devices if I wanted to cancel my gradle run without interrumpting my workflow. With the device chooser showing before Gradle Build completion I am forced to have my devices physically connected before starting my build;

Manifest Merger Error - Different versions of support library

拈花ヽ惹草 提交于 2020-01-11 08:19:23
问题 I'm adding the stepper indicator library - https://github.com/badoualy/stepper-indicator - to my project. To do so, I added jitpack to my project gradle file and the stepper-indicator library to my app gradle file. However, I'm getting the following build error: Error:Execution failed for task ':app:processDebugManifest'. > Manifest merger failed : Attribute meta-data#android.support.VERSION@value value=(25.4.0) from [com.android.support:preference-v14:25.4.0] AndroidManifest.xml:25:13-35 is

The SDK platform-tools version (24.0.4) is too old to check APIs compiled with API 25; please update

China☆狼群 提交于 2020-01-11 08:16:48
问题 I am getting this error on the latest version of Android Studio and while I have installed both Android SDK Platform API 25 and Android SDK Build-Tools 25. 回答1: I had a similar problem. Updating Android Studio to version 2.2.2 (latest at the time of this writing) and Gradle version to 2.2.2 (latest at the time of this writing) in project_name/build.gradle file fixed this issue. For reference, this is my config in project_name/app/build.gradle file: minSdkVersion = 19 targetSdkVersion = 25

Is Android Studio ready for production? [closed]

一个人想着一个人 提交于 2020-01-11 08:03:48
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 5 years ago . I know Android Studio is at its early access stage. Is it ready for production at all? Does anyone know and has anyone deploy an app from Android Studio? 回答1: No it is not. In fact it is available as an alpha release. As the Android Team report on its website Caution: Android

How to exit the android application on backpress?

倖福魔咒の 提交于 2020-01-11 07:37:06
问题 The situation could be like say, I've 5 activities. Say Main activity, Activity 1, Activity 2, Activity 3 and Activity 4. One can use the Activity 1,2,3 & 4 directly with the help of buttons so inserted on Main Activity layout. Situation: User enters into the Main Activity, and presses a button to enter into Activity 2. Then he back presses and comes back to Main Activity. from there he now enters Activity 3 with the help of another button and similarly when he presses back button he enters