android-studio

Android Spinner will not launch OnItemSelected and current selected item is not displayed in Spinner

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-06 18:14:04
问题 Here is a simple gif of the application in action to show what I mean: Video Gif here I have a Spinner and here is my XML code for it: <Spinner android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@+id/uniSpinner" android:layout_weight="1.5" android:spinnerMode="dialog" android:prompt="@string/type_default"/> I have followed a few tutorials and browsed around on here to dynamically add content to the spinner using parse.com. The content is added successfully but

How can I make an android xml layout for Category and CategoryItem

不羁岁月 提交于 2020-01-06 16:04:37
问题 I'am new in using java and android studio and i was wondering how can i make a layout like this in 1 activity. myImage 回答1: What you are looking for is a Listview adapter public class ExampleAdapter extends BaseAdapter { List<Product> products; private Activity context; @Override public int getCount() { return products.size(); } public ExampleAdapter(List<Product> products, Activity context) { this.products = products; this.context = context; } @Override public Object getItem(int position) {

How can I make an android xml layout for Category and CategoryItem

↘锁芯ラ 提交于 2020-01-06 16:03:32
问题 I'am new in using java and android studio and i was wondering how can i make a layout like this in 1 activity. myImage 回答1: What you are looking for is a Listview adapter public class ExampleAdapter extends BaseAdapter { List<Product> products; private Activity context; @Override public int getCount() { return products.size(); } public ExampleAdapter(List<Product> products, Activity context) { this.products = products; this.context = context; } @Override public Object getItem(int position) {

Replace project name with variable in Android Studio modules.xml

坚强是说给别人听的谎言 提交于 2020-01-06 14:44:06
问题 We have issues in our team because each developer has different folder structure so the name of project is different too. Is it possible to use some variable to automaticaly substitute the last part of .iml file name? In following example of modules.xml , the project name is MyProject but other team members have e.g. HisProject . <?xml version="1.0" encoding="UTF-8"?> <project version="4"> <component name="ProjectModuleManager"> <modules> <module fileurl="file://$PROJECT_DIR$/MyProject.iml"

how to edit unity exported gradle project in android studio (mainly unity's .cs files / scripts)

拜拜、爱过 提交于 2020-01-06 14:32:09
问题 I have exported a game made in Unity and exported it to Android studio (using Unity build panel, using Gradle build with export option ticked) in Unity. Then I went to Android studio and imported the project. Got lots of problems in the process (build.gradle errors and many more), spending lots of hours until all errors are fixed by now (meaning I can test the app on my mobile). Now I want some of the .cs files edited. I need to update and change some of the scripts . But I don't want to go

Android Bitmap usage Optimization

喜欢而已 提交于 2020-01-06 14:27:37
问题 I've been reading up on different ways to use bitmap each with there own pros and cons. And so I have a question that hasn't really been answered in my search. I have a massive memory leak in my application. So I working through solving the problem, and I use several bitmaps. One Bitmap in particular is used many times by different objects. I call the bitmap image and draw text on it using a Canvas and then compress and save the image in a resolution that suits the device that is using it.

How to use Appium with Android Studio?

江枫思渺然 提交于 2020-01-06 13:07:23
问题 I'm trying to use Appium with Android Studio. My search on google doesn't helped much out! So what do I need in the gradle file and how to run the tests? Thanks 回答1: Your gradle file should be like this: apply plugin: 'java' repositories { mavenCentral() } dependencies { Mention all your jar here } From command line you can run your gradle(gradle assemble) to create the jar of your test and then you can run that jar. 来源: https://stackoverflow.com/questions/28969685/how-to-use-appium-with

Including entire project as library android studio

十年热恋 提交于 2020-01-06 12:55:51
问题 I am trying to import my own library into one of my apps in Android Studio. I have seen instructions in several places that basically amount to : 1 Move the files into a library folder within your project diectory. 2 Add include 'projectName:folderName:libraryName to your settings.gradle file 3 Add compile project('folderName:libraryName') under dependencies to your project level build.gradle file This works for me if I am importing a module... I think its a module. I'm still trying to figure

Dialog doesn't appear after system broadcast

廉价感情. 提交于 2020-01-06 09:04:53
问题 I made this small app, it didn't get any build errors, it runs on the emulator without crashing, but it is not listening to system broadcasts as it should have. Please help me in finding the problem with this code. What the code should do: Whenever there are any ringer mode changes, the app should listen to them , trigger an activity to appear as a dialog to say "Ringer Mode Changed". I intentionally didn't use a toast, because I eventually need a dialog to complete the task at hand. The Code

Gradle DSL cannot find sources()

冷暖自知 提交于 2020-01-06 08:18:11
问题 I'm quite new to AR and I'm using Android Studio 2.1.2 and I tried to run the examples provided by ARToolKit. the error says: Gradle DSL method not found: 'sources()' I'm using Gradle 2.13 , below is the code apply plugin: 'com.android.application' android { compileSdkVersion 23 buildToolsVersion "23.0.3" defaultConfig.with { applicationId "org.artoolkit.ar.samples.ARSimple" minSdkVersion 15 targetSdkVersion 22 versionCode 1 //Integer type incremented by 1 for every release, major or minor,