How to get a special layout xml file in another application

by quill » Fri, 13 Mar 2009 13:09:58 GMT


Sponsored Links
 Hi, guys,
I want to inflate a layout xml file(in different apk), so I use
res = getPackageManager().getResourcesForApplication(appname); to get
the resource; and than use mInflater.inflate(res.getLayout(resId),
null); to inflate the layout.
The problem is, when the xml file is defined as follows:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android=" http://schemas.android.com/apk/res/ 
android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
<TextView
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="hello"---------------------------------------->note
this
    />
</LinearLayout>
It works correctly, the text "hello" will be show on the screen.
But when I defined the xml file like this:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android=" http://schemas.android.com/apk/res/ 
android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
<TextView
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="@string/hello"--------------------------------------
    />
</LinearLayout>
you know, the text was difined by string ids, so when my application
load this, it can't find the string id. How can I do?
--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Multiple Instance of Media Player in Android G1

Hi All,

Can we create multiple instance of media player i.e PV multimedia
framework (opencore) from application?

Thanks in advance,
Yogi

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

2. Audio Flinger and Mixer operations

Hi,

I'd like to know if the Audio Flinger uses the same mixer buffer for
combining Audio streams from Media Service playback [ Potentially
large buffer] , System sound [ ringtone , DTMF etc ] , {*filter*} Audio
[ Low latency ; small buffer ; ] at a given time. Usually {*filter*} Audio
might also use Media Service playback ; so essentially there may be 2
or more PV playback inputs to Audio Flinger. The concern is that
although the MIO Audio component supports Flush [ in case of a seek/FF/
Rewind on a stream] ; the next flush will be done at the DSP/H/W
level; which will not be able to distinguish between type of data if
it is mixed. It would be nice to not mix a Large Media Service output
buffer for optimization purposes with System sound ; as a flush at the
h/w will cause no system sound to be played or if the mixing is done
in serial fashion ; the time senstive System sound will play after a
large playback buffer has finished playing.

Manu
--~--~---------~--~----~------------~-------~--~----~

3. Can somebody provide a gps test app?

4. How to get source code of default Messaging application in Android?

5. Edit Contacts Database

6. Dalvik VM init failed (check log file)

7. How to get source code of default Messaging application in Android?