android-resources Questions
1
I'm doing a project where there's a search feature, but only enabled if the labels searched for are translated in the device's language. Is there any way to check if a resource exist in a specific ...
Amelita asked 31/3, 2018 at 15:24
3
Solved
I saw this post that says when strings.xml gets too big the app may crash. My strings.xml file is 800 plus lines right now and it will be a lot bigger in a while.
The answers in the post say that...
Fluting asked 23/12, 2018 at 10:29
9
Solved
I've found an unused string resource, like:
<string name="obsoletestring">my name is null!</string>
However it is in tens of files, of different languages, in different strings.xml f...
Lerner asked 9/3, 2015 at 8:13
8
Solved
Android O introduces a new feature, Fonts in XML, which lets you use fonts as resources. And I am creating the font folder in resource file as it provided by Android developer, but the problem is t...
Hangout asked 11/8, 2017 at 10:56
4
Solved
I'm interested in defining my many flavors of my apps more so in the strings.xml files rather than the build.gradle. Given multiple flavors, I'd like a simplified release/debug variant:
buildType...
Nacred asked 4/4, 2016 at 23:25
9
Solved
So I want to get the value of a String in several locales regardless of the current locale setting of the device/app. How should I do that?
Basically what I need is a function getString(int id, St...
Franek asked 28/2, 2012 at 2:30
1
Sometimes when I use a string resource in my composable, the preview will show the wrong string. It always works fine for literal strings, only string resources are wrong. The bug isn't consistent....
Schizophyceous asked 21/1, 2023 at 21:0
5
Let's say I have the following strings.xml resource file:
<resources>
<!-- basic string -->
<string name="app_name">My Playground</string>
<!-- basic string...
Swanner asked 25/1, 2021 at 16:53
2
tl;dr: Why do I need a file_paths resource, when I retrieve a file_path dynamically during runtime?
I am currently learning Android Studio by building my own app.
What I want to do right now is to...
Kaceykachina asked 3/2, 2018 at 14:59
2
I like Clean architecture however something that has always troubled me is the access to Resource files across layers.
I know that layers other than the View layer shouldn't have references to any...
Slier asked 12/6, 2020 at 16:39
6
Solved
I have strings defined in the usual strings.xml Resource file like this:
<string name="hello_world"> HELLO</string>
Is it possible to define format strings such as the one below
re...
Hubsher asked 27/9, 2012 at 18:2
19
Solved
I am reusing ImageViews for my displays, but at some point I don't have values to put it.
So how to clear an ImageView in Android?
I've tried:
mPhotoView.invalidate();
mPhotoView.setImageBitmap(...
Extinctive asked 18/5, 2010 at 16:35
15
Solved
I need to pass a resource ID to a method in one of my classes. It needs to use both the id that the reference points to and also it needs the string. How should I best achieve this?
For example:
...
Kessiah asked 13/12, 2010 at 9:55
11
Solved
I'd like to load the value as it is.
I have two dimension.xml files, one in /res/values/dimension.xml and the other one in /res/values-sw360dp/dimension.xml.
From source code I'd like to do somet...
Halicarnassus asked 20/6, 2012 at 13:44
18
Solved
I've found the R.string pretty awesome for keeping hardcoded strings out of my code, and I'd like to keep using it in a utility class that works with models in my application to generate output. Fo...
Arbuthnot asked 23/11, 2010 at 6:23
2
I am currently stuck on an error that continues to slow down the performance of my application.
The error does not cause the application to close or crash, or to write an exception to the console. ...
Breeks asked 6/11, 2020 at 17:34
7
Solved
I need the name (String) of all files in res/raw/ directory.
I tried:
File f = new File("/");
String[] someFiles = f.list();
It looks like the root directory is the root of the android ...
Philharmonic asked 30/6, 2011 at 18:57
4
Solved
In my values folder I have my_colors.xml:
<resources>
<!-- Orange -->
<color name="orangePrimary">#f6a02d</color>
<color name="orange1">#e3952a</color>
<...
Paynter asked 2/10, 2016 at 13:3
6
I am building an Android App in Visual Studio. When I try to build the app referencing items in the Resources folder, I get one of two errors.
If I preface "Resource.Layout.[Id]" or "Resource.Id.[...
Setter asked 30/5, 2014 at 13:15
12
I just started learning and working with "Android Studio" software and editing a project. It took too long to figure out how to work with that. I just fixed many errors and now i know man...
Rivalee asked 28/2, 2021 at 19:37
2
Solved
I am new in JUnit testing on Android and I'm testing a function, which is using android context object to get a string resources and making some comparsions. How can I mock android context object t...
Cambrel asked 9/9, 2019 at 10:25
4
Solved
When I use resolveAttribute() to find out a color value of ?attr/colorControlNormal, I got 236:
TypedValue typedValue = new TypedValue();
getTheme().resolveAttribute(R.attr.colorControlNormal, typ...
Mikol asked 19/3, 2018 at 11:19
5
Solved
I have the following selector defined in an XML file under res/color/redeemlist_item_color.xml:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com...
Illfated asked 12/4, 2011 at 23:40
17
Solved
I want to read strings from an xml file before I do much of anything else like setText on widgets, so how can I do that without an activity object to call getResources() on?
Lenten asked 8/12, 2010 at 20:3
2
Solved
I made an androidLibrary project which contains some Volley request classes,
and want to write a unit test for some of these requests.
I have done that like a hundred times, and it works somehow ...
Erebus asked 25/5, 2018 at 14:1
1 Next >
© 2022 - 2024 — McMap. All rights reserved.