android-studio

How to make Focus to FloatingActionButton Even if the Navigation drawer is open in Android

为君一笑 提交于 2020-01-24 01:11:06
问题 I want to make focus on FloatingActionButton Even if my Navigation Drawer is open. I know when the navigation Drawer is open then rest of the screen is unfocusable by using setScrimColor this we can reduce the focus on Navigation Drawer. But I want to make FloatingActionButton is focusable. Library is below for ActionButton https://github.com/shell-software/fab see the below screenshot for my problem. Normal Screen : Click on FloatingButton : What I want like this Focusable : activity_main

How to delete all files in a directory java android app? Current code is deleting the that folder

a 夏天 提交于 2020-01-24 01:10:08
问题 This is my code private final static String Dir = "/data/data/org.xbmc.kodi/cache/"; private void deleteDir(){ try{ /*File dir = Utils.getCacheDir(null, this, false, true); File path = new File(dir.getParentFile(), Dir); delete(path);*/ String command = "rm -r "+Dir; Process process = Runtime.getRuntime().exec("su"); DataOutputStream os = new DataOutputStream(process.getOutputStream()); os.writeBytes(command + "\n"); os.writeBytes("exit\n"); os.flush(); process.waitFor(); }catch(Exception e){

mMap is null when trying to create a new marker

落花浮王杯 提交于 2020-01-24 00:35:34
问题 so, after a year or two i started this project again... by the time it was outdated it worked fine... but since android x came out i wanted to upgrade my application and got stuck on a error i find it funny... quick brief, i have button that makes me online / offline.. on pressing the button the map should zoom at my curr. location and add a marker.. but here comes the error : Logcat: Process: com.app.mk.transport, PID: 22142 java.lang.NullPointerException: Attempt to invoke virtual method

Retrieving data in alphabetical order using Firebase in Android Studio [duplicate]

半腔热情 提交于 2020-01-24 00:31:07
问题 This question already has answers here : How can I sort an ArrayList of Strings in Java? (5 answers) Closed 4 years ago . This question is a follow up question from a previous post. Is there anyway to order the results alphabetically? I'm looking for something like Query 's orderByValue() . ... protected ArrayList<String> usernames = new ArrayList<>(); Firebase userRef = ref.child("users"); userRef.addListenerForSingleValueEvent(new ValueEventListener() { @Override public void onDataChange

Android new project no code, apk is 4 mb

半世苍凉 提交于 2020-01-23 17:05:13
问题 I'm creating a simple pro package to unlock features in my free app. My free app will check if the pro package is installed and unlock pro features if its installed. I created a new project, with no activity. When I pushed it the app to my device it says it's 4 mb in size. Why is it so big when theres no code? Looking at other apps with pro unlockers, they seem very small like 100-200 kb. build.gradle: apply plugin: 'com.android.application' android { compileSdkVersion 21 buildToolsVersion

Android studio: emulator-x86.exe stopped working after creating the window for the emulator

早过忘川 提交于 2020-01-23 16:06:11
问题 I just installed Android studio, and I am now trying to set up the device emulator. But it keeps crashing in the middle of invoke process. The error says: emulator-x86.exe stopped working in the middle of invoking I've tried to: Change the resolution of the device to 800X600. Reduce the size of the Ram by 512 MB. But it didn't work out. For example, below is the message be in the 'Run' panel in the Android Studio: C:\Users\VAIO\AppData\Local\Android\sdk\tools\emulator.exe -netdelay none

Android studio: emulator-x86.exe stopped working after creating the window for the emulator

故事扮演 提交于 2020-01-23 16:06:06
问题 I just installed Android studio, and I am now trying to set up the device emulator. But it keeps crashing in the middle of invoke process. The error says: emulator-x86.exe stopped working in the middle of invoking I've tried to: Change the resolution of the device to 800X600. Reduce the size of the Ram by 512 MB. But it didn't work out. For example, below is the message be in the 'Run' panel in the Android Studio: C:\Users\VAIO\AppData\Local\Android\sdk\tools\emulator.exe -netdelay none

Android SDK - Do You Need to Download Sources with Android API Versions?

会有一股神秘感。 提交于 2020-01-23 15:37:09
问题 I am using Android Studio and its SDK Manager to download API versions for Android development. I am wondering if I need to download the "Sources" items for the API versions I want to work with (see screenshot below). I don't need to change any source code or anything like that; I'm just doing normal Android development. 来源: https://stackoverflow.com/questions/59404778/android-sdk-do-you-need-to-download-sources-with-android-api-versions

Android SDK - Do You Need to Download Sources with Android API Versions?

我们两清 提交于 2020-01-23 15:37:05
问题 I am using Android Studio and its SDK Manager to download API versions for Android development. I am wondering if I need to download the "Sources" items for the API versions I want to work with (see screenshot below). I don't need to change any source code or anything like that; I'm just doing normal Android development. 来源: https://stackoverflow.com/questions/59404778/android-sdk-do-you-need-to-download-sources-with-android-api-versions

How to accept debugging dialog for Android Emulator via command line

岁酱吖の 提交于 2020-01-23 13:15:31
问题 I'm writing an automated emulator script that will create and launch an Android emulator so I can run my UI tests from any machine and guarantee that it'll run on a device. My current script creates an android-27;google_apis;x86 device which works fine, but lacks google services so the maps in my app do not show. I tried creating an emulator using google_apis_playstore , but when the device boots, it prompts with an ADB debugging prompt. Normally tapping this would be fine, but Im expecting