android-xml

“No resource found that matches the given name” error

浪子不回头ぞ 提交于 2020-01-01 19:23:46
问题 In my application I get this error for all drawalbes that I have in the folder res/drawable: [2011-05-15 16:07:47 - Marmara] libpng error: Not a PNG file [2011-05-15 16:07:47 - Marmara] ERROR: Failure processing PNG image D:\WorkSpace JEE\Marmara\res\drawable\waiting.png [2011-05-15 16:07:47 - Marmara] D:\WorkSpace JEE\Marmara\res\layout\detail_promo.xml:55: error: Error: No resource found that matches the given name (at 'src' with value '@drawable/ombreinterne_imghp'). I've tried to move all

Custom XML attributes without custom View in Fragment

我怕爱的太早我们不能终老 提交于 2020-01-01 05:18:13
问题 I'm trying to add custom XML attributes in existing View Adding them to a custom View is not a big deal but I don't know how to access those attributes in a "basic" View (e.g. TextView, LinearLayout, ImageView ...) And this is more difficult when there are Fragment and / or Library project involved So far here is my code Customs attributes definitions and XML (attrs.xml and the layout): <?xml version="1.0" encoding="utf-8"?> <resources> <declare-styleable name="StarWars"> <attr name="jedi"

Match URIs with <data> like http://example.com/something in AndroidManifest

試著忘記壹切 提交于 2020-01-01 04:53:10
问题 I am struggling with the <data> element in the AndroidManifest.xml file to get my URI matching working. I want to match the following URIs: http://example.com/something http://example.com/foo http://example.com/foo/ but not http://example.com http://example.com/ http://example.com/something/else I got it mostly working with <data android:scheme="http" android:host="example.com" android:pathPattern="/..*" /> <data android:pathPattern="/..*/" /> but it still matches http://example.com/something

String.xml or Constants class

回眸只為那壹抹淺笑 提交于 2019-12-31 09:15:29
问题 What is better approach of the following in designing an Android app To place all the String constants in res/values/Strings.xml or Create a class like Constant.java where all Strings are public static final ? Choosing which one of them is more efficient? 回答1: I imagine a constants class would be more efficient. However, speed shouldn't really be an issue in either case. I would recommend organizing based on what makes sense. Constants class Put strings constants that will be used internally,

How to parse xml using different parent nodes in android

一世执手 提交于 2019-12-31 05:15:32
问题 In my xml file I have two or more parent nodes like:- //parent node pizza //attributes are 1 Veg Pizza //parent node burger //attributes are 1 Veg Burger, Whenever the user clicks on pizza listview item then the user should be able to view only list of pizza items in another activity's listview . I know how to call next activity and so on, but I want to know how I can use different parent nodes in my java class, exactly what are the changes I need to do in my java class, please see this link,

Android Admob Not enough space to show ad

本小妞迷上赌 提交于 2019-12-31 04:28:30
问题 Used the code provided in admob site Here is my xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/background_img" android:orientation="vertical" android:id="@+id/atozlayout" > <GridView android:id="@+id/gridView1" android:numColumns="auto_fit" android:gravity="center" android:columnWidth="55dp" android:stretchMode="columnWidth

Android how to create the stack kind of image backgrounds

寵の児 提交于 2019-12-30 10:28:11
问题 I am developing an App where i need to create Albums and display them in a GridView. Now i am just displaying them without any background but i need a background for the Album cover so that it looks like a pile of photos. Background something like this: I tried out this but not it's working: first i created a single background like this: <shape xmlns:android="http://schemas.android.com/apk/res/android" > <solid android:color="#FFFFFF" /> <stroke android:width="1dp" android:color="#000000" />

Repeating style in v19/v21

送分小仙女□ 提交于 2019-12-30 04:03:41
问题 I have this in my styles.xml : <style name="UserTheme" parent="ThemeBase"> <item name="android:editTextStyle">@style/EditTextTheme</item> </style> Why do I have to repeat the editTextStyle line in v19/styles.xml and v21/styles.xml . v21/styles.xml : <style name="UserTheme" parent="ThemeBase"> <item name="android:windowTranslucentStatus">true</item> <item name="android:windowTranslucentNavigation">true</item> <item name="android:editTextStyle">@style/EditTextTheme</item> </style> Is there a

how to change color of the actual scroll in ScrollView android?

梦想与她 提交于 2019-12-29 18:44:10
问题 I'm wondering if it's possible to change the color of the ScrollView. I'm not referring to the background color or the edges. I attached a print screen of the bar I'm referring. For me, it's kind of transparnt. Here's how I defined it in the xml: <ScrollView android:layout_width="wrap_content" android:layout_height="wrap_content" android:fadeScrollbars="false" android:layout_toLeftOf="@+id/personalscores_BackButton" android:layout_marginRight="0dp" > 回答1: Create a scroll bar in drawable

Android XML Layout for all Devices (Small/Normal/Large/XLarge, etc)

佐手、 提交于 2019-12-29 13:32:45
问题 I want to create a XML Layout that will support all the Screen sizes. In the XML, first element is ImageView , second one is TextView and third one is Button with an Image. So the TextView should be the exact position in all the devices (small, medium, large, xLarge, etc). How can I do this? Here is the XML output should be look like: Here is the XML file that i created for the Normal/Medium Layout: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android