android-xml

Android Dynamically Add Item to Array XML Resource

不问归期 提交于 2019-12-10 13:29:24
问题 Is there any way I can add items in code to a String-Array resource? For instance, if I want to create a spinner that shows the user values, and I want to allow the user to add their own custom values. 回答1: No. this is not supported because resources are packaged in the binary .apk and as such cannot be changed. Don't follow this design pattern, change your approach. 回答2: probably JoxTraex has no idea on android framework or as they are saying: when someone says this can't be done - there

Android: Best parser to parse XML data [closed]

人盡茶涼 提交于 2019-12-10 13:24:48
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 4 years ago . I am developing an application in which the first time I am going to parse data from an xml file coming from a remote server. But i am not able to select which parser is efficient or best suited for parsing. As there are mainly three types of parsing, which i know : SAX

Android- How to differentiate Galaxy S-3 and Galaxy S-4 layouts?

倾然丶 夕夏残阳落幕 提交于 2019-12-10 13:24:22
问题 I am having problem differentiating layout folders for samsung galaxy s4 and samsung galaxy s3. I have tried layout-sw360dp, layout-sw360dp-xxhdpi, layout-sw360dp-xhdpi etc. All the time galaxy s4 and galaxy s3 both picks from layout-sw360dp-xhdpi. So what should be the correct layout folder for both of these devices ? 回答1: I am using some specific resolution values in my projects in order to differentiate these from other layouts and screens. You can create layouts with exact minimum height

Error inflating class de.hdodenhof.circleimageview.CircleImageView in Android version 6 marshmallow

六眼飞鱼酱① 提交于 2019-12-10 13:24:11
问题 I created an app which uses this hdodenhof CircleImageview library. My app works fine on Android 7 and 7.1 but it is crashing in lower versions such as marshmallow/Android 6. How can I solve this problem? I have read his GitHub posts but it did not solve my problem as people has asked to remove attributes from the .xml, but I didn't use these attributes. Here's my simple implementation of the CircleImageView: <de.hdodenhof.circleimageview.CircleImageView android:id="@+id/civ_requests" android

how do i use both scroll view and RecyclerView in one xml layout android?

可紊 提交于 2019-12-10 11:01:46
问题 In my application i am using recycler view and scrollview in one layout. it is not working when i am using both these views. If i remove scroll view only the recycler view is working. Plese any one help me hoe to fix this issue. my code: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/r1" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/background" >

Android data storage in xml

空扰寡人 提交于 2019-12-10 08:17:06
问题 I have a web platform that stores data for an application that I am building. The web platform is built with Ruby on Rails and the main app is for Android. I am curious to know about any performance issues of storing my data in an XML file (for the android app). Eventually my database in the web app is going to have about 2000 entries (like articles / Article category -> Article - content, description, title, image path). Is it better to use SQLite or an XML file to store my data? 回答1: When

Create android buttons programmatically using XML layout as template

夙愿已清 提交于 2019-12-10 03:52:34
问题 I have a LinearLayout that contains a TextView, and always will. There will also always be at least one button located below the TextView, but there might be more than one under certain circumstances. I can successfully create and add as many buttons as I need programmatically. I can also successfully set whatever appearance related parameters/options that I require for these buttons programmatically. The problem is that I don't know how to tell a programmatically created button that it

Why is the Fragment element in Android layout written with a lower case 'f'?

六眼飞鱼酱① 提交于 2019-12-10 03:26:21
问题 All other elements start with an upper case letter, like RelativeLayout, TextView, etc. Is there a particular reason why the Fragment element is always used as <fragment ... /> instead of <Fragment ... /> ? 回答1: Fragments when defined in XML aren't actually views. The full view name is specified, or it assumes android.view for the package and finds the rest. But a fragment is only truly specified when it includes the android:name tag. It acts like a keyword, which are typically written in

EditText input type textCapSentences not working on Lollipop

拈花ヽ惹草 提交于 2019-12-10 01:08:29
问题 I have implemeted android:inputType="textAutoComplete|textCapSentences" in my xml code. When I run it on kitkat , textCapSentence works fine but when build is run on Lollipop device it does not work. Anybody knows how to solve it. 回答1: Hi this is because in lollipop if you have disabled Auto - Capitalization in keyboard settings then you can't enable it programmatically. here are the steps:- Tap icon of ‘Settings’ on the Home screen of your Android Lollipop Device At the ‘Settings’ screen,

Sliding animation having multiple views synchronization issue

[亡魂溺海] 提交于 2019-12-09 22:21:53
问题 I am trying to make an animation with two textviews. Both are in a relative layout. The functionality of the animation is left textview will go little bit left and at the same time right textview will also go little bit left. I have tried: http://nineoldandroids.com/ and default way. But for both case I am getting a gap during the process. I already put one question but i am not getting any positive reply: Android slider animation is not synchronized Nineoldandroids code: xml file: