How to use drawable resource in custom XML?

by Robi » Thu, 10 Sep 2009 06:14:58 GMT


Sponsored Links
 Hey guys,

so I have an XML file: xml/catalog.xml
which contains gallery and pictures.

Like this:

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
        <catalog xmlns:myres=" http://schemas.android.com/apk/res/android" ;>
                <gallery title="@string/gallery01" 
thumbnail="@drawable/t_gallery1">
                        <picture thumbnail="@drawable/pic_01">
                        </picture>
                        <picture thumbnail="@drawable/pic_02">
                        </picture>
                        <picture thumbnail="@drawable/pic_03">
                        </picture>
                </gallery>
        </catalog>

In my view I can extract the attribute values using getAttributeValue
() in XmlPullParser, and the result is a string.
But could I somehow get the drawable resource right away? (That's why
I put the @ in the beginning)

getAttributeNameResource() gives null so that ain't good.

Any ideas?

--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. about get cid

hi all!
    Please tell me how to obtain cell id.

-- 
====================
xiemingming
mail: aimery....@gmail.com
msn: xmmarmy...@hotmail.com
qq: 182378175

-- 

2. Live report from Shenzhen

Malang jauh ndro..



*minggat*



Salam
Dzikki 
k...@tux.or.id


-----Original Message-----
From: "hendro gunawan" <pawangratj...@naekgenteng.com>
Date: Wed, 28 Apr 2010 09:41:24 
To: Id Android<id-android@googlegroups.com>
Subject: Re: [id-android] Live report from Shenzhen

Aku kok ditinggal?

Aku kan tim jeruk nipis...

*usap in*us di baju ompong*

sent using Google Superphone
pawangratj...@naekgenteng.com

-----Original Message-----
From: yopie suryadi <android.em...@ratjoen.com>
Date: Wed, 28 Apr 2010 16:38:00 
To: id-android@googlegroups.com<id-android@googlegroups.com>
Subject: [id-android] Live report from Shenzhen

Mantep wifinya...
Sekalian mau tes email google bisa apa gak nih...
Kebetulan lagi disini,bareng sama team jeruknipis kita melakukan factory
visit ke Huawei....
Besok reportnya yah...hari ini leyeh2 dulu: p

sent from milestone

-- 
"Indonesian Android Community [id-android]" 

3. ask - U8230 MoDaCo tidak bisa A2SD

4. Can someone tell me why this is failing?

5. help! oprek G1 >.<

6. Permission Denial: writing com.android.providers.settings.SettingsProvider

7. (ASK) Setelah App2sd di Spica 2.1, cara ngeceknya?