android-studio

Can't load image from raw to imageview

风格不统一 提交于 2021-01-28 05:53:49
问题 I want to load image using setImageResource, from raw folder to imageview, But I get Expected resource of type drawable error. I'm using android studio, Before that when I was using Eclipse everything was fine. I don't want to use drawable folder. raw folder: Any suggestion? Thanks 回答1: I want to load image using setImageResource, from raw folder to imageview, But I get Expected resource of type drawable error. Using a raw resource for setImageResource() is not documented behavior. Before

Installation failed with message Failed to create install session with 'cmd package install-create -r -t -S 1647504'

痞子三分冷 提交于 2021-01-28 05:40:33
问题 I am getting an error message while trying to run an apk through android studio 3.4.1 Installation failed with message Failed to create install session with 'cmd package install-create -r -t -S 1647504'. It is possible that this issue is resolved by uninstalling an existing version of the apk if it is present, and then re-installing. i have tried cleaning the project, rebuilding the project and unchecking the instant run option as well, none of them seems to have worked 回答1: The below is the

Android Studio - Could not find org.jetbrains.kotlin:kotlin-stdlib:1.1.3-2

社会主义新天地 提交于 2021-01-28 05:34:22
问题 I was tring to compile my project in Android Studio (using Java) and the following error appeared: Could not find org.jetbrains.kotlin:kotlin-stdlib:1.1.3-2. Searched in the following locations: - https://maven.fabric.io/public/org/jetbrains/kotlin/kotlin-stdlib/1.1.3-2/kotlin-stdlib-1.1.3-2.pom - https://maven.fabric.io/public/org/jetbrains/kotlin/kotlin-stdlib/1.1.3-2/kotlin-stdlib-1.1.3-2.jar - https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-stdlib/1.1.3-2/kotlin-stdlib

Specify targets in externalNativeBuild of the build.gradle file-> No signature of method

感情迁移 提交于 2021-01-28 05:13:31
问题 Start a new native c++ project in android studio 4.1.1. Go to build.gradle of the module Add a targets line: externalNativeBuild { cmake { path "src/main/cpp/CMakeLists.txt" version "3.10.2" targets "native-lib" // New line } } Somehow I get an error when I click the green play button (Run 'app'): Build file '<project folder>/app/build.gradle' line: 5 A problem occurred evaluating project ':app'. > No signature of method: build_bcdq4hni531na6stswx8a7txx.android() is applicable for argument

How to perform a touch and hold gesture using AccessibilityService?

回眸只為那壹抹淺笑 提交于 2021-01-28 05:13:13
问题 Path clickPath = new Path(); clickPath.moveTo(x, y); GestureDescription.StrokeDescription clickStroke = new GestureDescription.StrokeDescription(clickPath, 0, 1); GestureDescription.Builder clickBuilder = new GestureDescription.Builder(); clickBuilder.addStroke(clickStroke); dispatchGesture(clickBuilder.build(), null, null); With this code I can perform clicks anywhere on the screen. Is there any way to perform touch and hold gesture using AccessibilityService? 回答1: Is there any way to

UIL doesn't support scheme(protocol) by default

元气小坏坏 提交于 2021-01-28 05:02:05
问题 I am getting this error in my console. UIL doesn't support scheme(protocol) by default ["http://mywebsite.com/mylocation/image.jpg"]. You should implement this support yourself (BaseImageDownloader.getStreamFromOtherSource(...)) I am trying to load images from my website into an android application. Steps followed: In build.gradle dependencies {compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'} In AndroidManifest.xml <uses-permission android:name="android.permission

class does not implement ActivityResultLauncher AS ArcticFox

孤街醉人 提交于 2021-01-28 05:01:00
问题 I just installed the last version of Android Studio Arctic Fox | 2020.3.1 Canary 3. When I open my projects, studio shows error for all of the fragments : Class 'MapsFragment' is not abstract and does not implement abstract base class member public abstract fun <I : Any!, O : Any!> prepareCall(contract: ActivityResultContract<I!, O!>, callback: ActivityResultCallback<O!>): ActivityResultLauncher<I!> defined in androidx.fragment.app.Fragment is it AS bug? 来源: https://stackoverflow.com

Android Studio 3.1.3 does not show layout desing preview

て烟熏妆下的殇ゞ 提交于 2021-01-28 04:43:44
问题 It has passed some time since the last time I have created a new project in android studio and today when I did it the android studio does not show anything from the layout preview. Its a blank window and says "nothing to show". I already tried; updated the sdks tools, cleaned the project and rebuild it, invalidated and restarted caches, theme changes, and still nothing. Solution now i am using mac . 回答1: as my experience, switch to "Design".click "force refresh layout" 回答2: Did you update

How to connect Android Studio running inside WSL2 with connected devices or android emulator running on host

≡放荡痞女 提交于 2021-01-28 04:05:25
问题 I'm running Android Studio (currently in version 3.6.1) under Ubuntu 18.04 in WSL 2 (Windows 10 2004), which now supports GUI. Since virtualization inside WSL2 doesn't work, I need to keep running my emulator on the host and of course, connected devices which I use for debugging my android app appear on the host. How can Android Studio see the emulator and devices appearing on the host? 回答1: There is a way for the connected devices, but this has to be done one by one: on windows:adb tcpip

How to connect Android Studio running inside WSL2 with connected devices or android emulator running on host

会有一股神秘感。 提交于 2021-01-28 03:55:32
问题 I'm running Android Studio (currently in version 3.6.1) under Ubuntu 18.04 in WSL 2 (Windows 10 2004), which now supports GUI. Since virtualization inside WSL2 doesn't work, I need to keep running my emulator on the host and of course, connected devices which I use for debugging my android app appear on the host. How can Android Studio see the emulator and devices appearing on the host? 回答1: There is a way for the connected devices, but this has to be done one by one: on windows:adb tcpip