android-resources

Different resources for WVGA800 and WVGA854?

↘锁芯ラ 提交于 2020-01-01 18:55:21
问题 Got this really stupid problem: Can find the proper name for the android folder for WVGA800 resources. I've created a folder for WVGA854: drawable-normal-long-hdpi It worked totally fine. For WVGA800 I've tried 'drawable-normal-notlong-hdpi' - emulator and handset still gets resources from 'drawable', not even 'drawable-normal-long-hdpi'. Tried using 'drawble-hdpi', 'drawable-notlong-hdpi' - nothing works, it keeps using 'drawable' for resources. How should the folder for WVGA800 be named?

Conditional resource inclusion/exclusion for Android apk build

半城伤御伤魂 提交于 2020-01-01 09:09:12
问题 I keep coming back to this problem, since there doesn't seem to be a clean solution. Does anyone have a good strategy to exclude resources from a child project in Android? I have two scenarios: 1 - Base library project has localization files for en, es, etc. --Child project 1 uses all localizations, and everything is good --Child project 2 is only localized to English, but the final .apk would have a partial localization due to the parent resources (although ADT19 or so added Lint rules to

Adding layout resources to androidTest

我们两清 提交于 2020-01-01 08:22:47
问题 I would like to add layout xml files into my androidTest folder to be used only for testing. I added res/layout folder to androidTest and tried to add a layout file to it. But it gives error URI is not registered for xmlns:android="http://schemas.android.com/apk/res/android" Somehow the project does not recognize it as valid layout file. 回答1: It is tricky to add xml resources to androidTest . Android Instrumentation tests create another APK to run the tests against your original application.

Adding layout resources to androidTest

半城伤御伤魂 提交于 2020-01-01 08:20:00
问题 I would like to add layout xml files into my androidTest folder to be used only for testing. I added res/layout folder to androidTest and tried to add a layout file to it. But it gives error URI is not registered for xmlns:android="http://schemas.android.com/apk/res/android" Somehow the project does not recognize it as valid layout file. 回答1: It is tricky to add xml resources to androidTest . Android Instrumentation tests create another APK to run the tests against your original application.

Set Notification Sound from Assets folder

元气小坏坏 提交于 2020-01-01 03:56:06
问题 I am attaching the sound files in the assets folder for play sound in the notification but I am not able to play sound from the assets folder. I have setting page from which user can set the sound for the notification and also user can play sound. This part is completed. I am able to play sound from the assets folder using Media Player. I can use same logic at the Notification creation time but problem can be happened when user click on the Notification because media player still playing the

How to remove unused resources from libraries?

别等时光非礼了梦想. 提交于 2020-01-01 03:19:13
问题 At first I know Remove all unused resources from an android project, but that is only for projects. I want to remove unused images from a library like the Google Play Services or the Wearable SDK. I already know that I can remove unwanted languages in gradle by using resConfigs, but I don't know how to remove images and layouts which I don't use. Is there any way to avoid that they are added? 回答1: I almost missed it to write that there is now a nice solution: android { buildTypes { release {

How can I get the fgcolor attribute to work on recent Android versions?

走远了吗. 提交于 2019-12-30 09:55:29
问题 I used to be able to do this: <string name="foo">white <font fgcolor="#ff6890a5">blue</font></string> But now it doesn't work any more. It seems to be a bug in the integer parsing code; see https://code.google.com/p/android/issues/detail?id=58192 Problem is, I'm getting customer complaints now ; I can't wait for the bug to be fixed. Does anybody know a work-around, such as using named resources from color.xml or something like that? ETA: I've discovered fgcolor="blue" still works, but it's

Resource cannot be found, No identifier for missing item

房东的猫 提交于 2019-12-29 07:52:11
问题 I looked at this question however, it did not help solve my problem: Resources$NotFoundException: Resource is not a Drawable I'm using ActionBarSherlock (version 4.4) within my app for compatibility in older versions. My app runs perfect on 4.1.2 but it crashes on 2.3.3. The app runs all the way up to the point of mDrawerLayout.closeDrawer(mDrawerList); then it crashes after that. I cannot figure out what is causing it to crash on older versions. I have a feeling that it is because it is

Android XML Percent Symbol

风格不统一 提交于 2019-12-27 10:29:28
问题 I have an array of strings in which the % symbol is used. Proper format for using the % is % . When I have a string in that array with multiple % it gives me this error. Multiple annotations found at this line: - error: Multiple substitutions specified in non-positional format; did you mean to add the formatted="false" attribute? - error: Found tag </item> where </string-array> is expected 回答1: The Android Asset Packaging Tool ( aapt ) has become very strict in its latest release and is now

Is it possible to separate resources access in Android Studio

二次信任 提交于 2019-12-25 08:29:32
问题 I have learned from this question that resources are globally shared in an Android Studio project. I have a project with 3 activities (and more are coming), and I already find pretty messy to have access to every resources in any given activity. Is there a way to allow an activity to access ids only from the associated layout ? eg : I have MainActivity.java, activity_main.xml, Main2Activity.java, activity_main2.xml . I would like to restrict the resources (mainly ids) accessible by