android-studio

Android: Add searchView on the Action Bar

筅森魡賤 提交于 2020-12-31 14:48:46
问题 My Complete Project Is As Follows: There is a listView connnected to database and a search option with suggestion . I wanna shift this search bar to the action bar and format it just like Google Play Store Search bar . Please help me, my complete codes are: MainActivity.java package com.GurbaniAndSikh.MahaanKosh; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.support.v7

How to List all Internal Storage Folders in Android Q (API Level 29)?

跟風遠走 提交于 2020-12-31 07:40:32
问题 I am new in programming and want to make a file manager in android studio. I am facing problems in listing all device folders in API level 29 after getExteralStorageDirectory was deprecated. 回答1: According to the documentation, you will have to use ACTION_OPEN_DOCUMENT_TREE. This will provide you with the URI of selected directory , once you have the URI then you can access all the children of that directory . From docs Grant access to a directory's contents File management and media-creation

How to List all Internal Storage Folders in Android Q (API Level 29)?

冷暖自知 提交于 2020-12-31 07:35:13
问题 I am new in programming and want to make a file manager in android studio. I am facing problems in listing all device folders in API level 29 after getExteralStorageDirectory was deprecated. 回答1: According to the documentation, you will have to use ACTION_OPEN_DOCUMENT_TREE. This will provide you with the URI of selected directory , once you have the URI then you can access all the children of that directory . From docs Grant access to a directory's contents File management and media-creation

Android Espresso test: Class not found: …Empty test suite

被刻印的时光 ゝ 提交于 2020-12-31 05:57:10
问题 I'm trying to implement things from this example - https://github.com/googlesamples/android-testing/tree/master/ui/espresso/BasicSample - into my app. When I try to execute the simple Espresso test, this happens: "/Applications/Android Studio 2.2.3.app/Contents/jre/jdk/Contents/Home/bin/java" (...) Process finished with exit code 1 Class not found: "com.faces_shop.app.MainActivityTest"Empty test suite. (copy-pasted from Android Studio) The test: package com.faces_shop.app; import android

Android Espresso test: Class not found: …Empty test suite

本小妞迷上赌 提交于 2020-12-31 05:56:07
问题 I'm trying to implement things from this example - https://github.com/googlesamples/android-testing/tree/master/ui/espresso/BasicSample - into my app. When I try to execute the simple Espresso test, this happens: "/Applications/Android Studio 2.2.3.app/Contents/jre/jdk/Contents/Home/bin/java" (...) Process finished with exit code 1 Class not found: "com.faces_shop.app.MainActivityTest"Empty test suite. (copy-pasted from Android Studio) The test: package com.faces_shop.app; import android

Disable dates in Material date picker in android studio [duplicate]

断了今生、忘了曾经 提交于 2020-12-31 04:52:05
问题 This question already has answers here : Restrict Range in Android DatePicker Custom Dialog (3 answers) Closed 7 months ago . I would love to have am an option where I would select a maxDate and a minDate using calendarConstraints. Just like the normal DatePicker has DatePicker.setMaxDate() and DatePicker.setMinDate() methods, I would love the same methods for materialDatePicker. I am using materialDatePicker in while developing my application and I am finding it difficult in setting the

Android Test cases not working in debug mode

那年仲夏 提交于 2020-12-30 08:01:03
问题 I am not able to debug android Instrumentation test cases (using espresso & UiAutomator) But earlier test cases the debugging was working fine but with recent update it is not working anymore. It gets always struck up at instantiating unit test I can see in command window that it's trying to launch PACKAGE_NAME**.test** adb shell am instrument -w -r -e debug true -e class PACKAGE_NAME.LanguageScreenTest#testSelectImportant PACKAGE_NAME**.test**/android.support.test.runner.AndroidJUnitRunner

How to disable Android Studio update notification?

生来就可爱ヽ(ⅴ<●) 提交于 2020-12-30 07:36:11
问题 I don't want to update to 2.3 (they broke Instant Run for 4.4.4 Devices, now it only works for 5.* and higher) Just want to hide the notification: 回答1: Open Android Studio then File -> Settings -> Appearance & Behavior -> Notifications Then uncheck "Display baloon notifications" 回答2: File -> Settings (or Android Studio -> Preferences for macOS) -> Appearance & Behavior -> Notifications . In the Group column you'll find groups like Android Gralde Upgrade Notification and Plugins Updates etc.

How to disable Android Studio update notification?

一世执手 提交于 2020-12-30 07:33:29
问题 I don't want to update to 2.3 (they broke Instant Run for 4.4.4 Devices, now it only works for 5.* and higher) Just want to hide the notification: 回答1: Open Android Studio then File -> Settings -> Appearance & Behavior -> Notifications Then uncheck "Display baloon notifications" 回答2: File -> Settings (or Android Studio -> Preferences for macOS) -> Appearance & Behavior -> Notifications . In the Group column you'll find groups like Android Gralde Upgrade Notification and Plugins Updates etc.

Gradle sync failed: com.android.tools.idea.gradle.project.sync.idea.issues.SdkPlatformNotFoundException: Module: 'app' platform 'android-29' not found

廉价感情. 提交于 2020-12-30 06:55:47
问题 Installed Android 4.1 on Ubuntu 20.04. Getting the following error: Gradle sync failed: com.android.tools.idea.gradle.project.sync.idea.issues.SdkPlatformNotFoundException: Module: 'app' platform 'android-29' not found. On opening the SDK manager I get the following screen: I also executed $ANDROID_HOME/cmdline-tools/tools/bin/sdkmanager --licenses How to fix this? ------ edit --------- This is what shows in the SDK Platforms tab. Unchecking the "Hide Obsolete Packages" doesn't change