android-studio

Problems setting the JAVA_HOME variable

筅森魡賤 提交于 2021-02-08 05:19:11
问题 So I just downloaded Android Studio, and am trying to set the JAVA_HOME variable so I can run it. I'm using windows 8 and have followed all the instructions I've been able to find to no avail... went to advanced system settings > environment variables and then set the JAVA_HOME variable with the value containing my path to jre7. I've double checked the path a million times, I don't see anything wrong with it(C:\Program Files (x86)\Java\jre7). I know the variable name is right, and I know that

Android Studio: Component is selected but Attributes editor says “No component selected”

女生的网名这么多〃 提交于 2021-02-08 04:00:52
问题 TL;DR: Although I can edit component attributes directly in XML (sanity check — I'm sane) the Attributes inspector pane claims nothing is selected. I.e. "It doesn't work." I added a CardView to the main layout. It does show up in the Component Tree and in the Design Editor. I select the CardView in the Component Tree pane, but the Attributes pane says "No component selected". I'm using Android Studio 3.5.2 on MacOS 10.15.1. This happens with all three CardViews (see screenshot). Clicking the

Could not find method compile()

故事扮演 提交于 2021-02-08 03:41:27
问题 I want to add a lib in android studio but it is not working. Here is a screenshot I also tried to add a dependency in the gradle.build but that also does not work. Maybe it is because I am behind a proxy ? 回答1: You are using the wrong build.gradle file. You can't use compile in the top-level file. Use the module/build.gradle . <PROJECT_ROOT>\app\build.gradle is specific for app module . <PROJECT_ROOT>\build.gradle is a "Top-level build file" where you can add configuration options common to

My Webview App keeps crashing for messenger chat

别来无恙 提交于 2021-02-08 02:39:34
问题 Everything works as it should except messenger. Code if (url.startsWith("www.messenger.com")) { Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); startActivity(intent); return true; } For messenger even for this general intent code it doesnt show the option to open with messenger if (url.startsWith("intent")){ Intent sendIntent = new Intent(); sendIntent.setAction(Intent.ACTION_VIEW); if (sendIntent.resolveActivity(getPackageManager()) != null) { startActivity(sendIntent); }

My Webview App keeps crashing for messenger chat

断了今生、忘了曾经 提交于 2021-02-08 02:37:51
问题 Everything works as it should except messenger. Code if (url.startsWith("www.messenger.com")) { Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); startActivity(intent); return true; } For messenger even for this general intent code it doesnt show the option to open with messenger if (url.startsWith("intent")){ Intent sendIntent = new Intent(); sendIntent.setAction(Intent.ACTION_VIEW); if (sendIntent.resolveActivity(getPackageManager()) != null) { startActivity(sendIntent); }

BulkTransfer & Android USB API

我与影子孤独终老i 提交于 2021-02-08 02:10:47
问题 I have a program in which I attempt to attach my android device to a webcam via USB. I'm having trouble with a few things, namely properly transferring data. I've tried using bulkTransfer and there seems to be no recognition of it being used. I've been trying to find examples that may assist me such as here but none are helping me - their structure seems to be better than mine but whenever I switch my program crashes on load. I'm fairly confident my bytes declaration is also incorrect and I

BulkTransfer & Android USB API

无人久伴 提交于 2021-02-08 02:08:28
问题 I have a program in which I attempt to attach my android device to a webcam via USB. I'm having trouble with a few things, namely properly transferring data. I've tried using bulkTransfer and there seems to be no recognition of it being used. I've been trying to find examples that may assist me such as here but none are helping me - their structure seems to be better than mine but whenever I switch my program crashes on load. I'm fairly confident my bytes declaration is also incorrect and I

Unable to instantiate activity:Attempt to invoke virtual method android.content.Context.getResources()

谁都会走 提交于 2021-02-07 20:50:45
问题 i am a beginner . First of all say that I have read previous posts but did not answer. I try to test a audio player,But when I try to run the app, it instantly crashes because of a null object reference. This is Logcat: (this log say: Error is in Line 28 of java code) EXCEPTION: main Process: ir.pluto.mediaplayer, PID: 19100 java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{ir.pluto.mediaplayer/ir.pluto.mediaplayer.MainActivity}: java.lang.NullPointerException: Attempt

How to receive a Json array (“result”) with retrofit2

只谈情不闲聊 提交于 2021-02-07 20:39:19
问题 I know how to receive arrays when they are this type: [ { "username": "luis", "job": "developer", "age": 23 } ] my problem is when I must receive an array with a specific name like this: {"result":[{"userid":"1","username":"Luis","job":"developer","age":"23"}]} in this case I must receive the array above with the name "result" using retrofit2. Can anyone please help me I'm new at Retrofit. This is what I have tried: MainActivity apiInterface = ApiClient.getApiClient().create(ApiInterface

Annotation processor not working - no files are created

前提是你 提交于 2021-02-07 19:22:12
问题 I've now searched for reasons why my own annotation processor is not working in ONE of my projects. Setup looks like following: Android Studio 2.3.3 gradle build tools 2.3.3 annotation processor is enabled in android studio I tried the common solutions: remove my project from Android Studio recents invalidate cache and restart android studio import my project again into android studio (made sure that annotation processing is enabled before) Nothing helps. I have annotation processing working