Can I initialize an Array list from data specified in xml resource file?

by Videoguy » Mon, 09 Mar 2009 23:24:10 GMT


Sponsored Links
 Is is possible to specify data in xml resource file and initialize
ArrayList from it?
I am looking for a way to use the ArrayList with a SimpleAdapter to
bind to a ListView.
I am wondering if there is a way to specify my data in xml resource
file and init ArrayList from it.

Videoguy
--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. :: problem with TextSwitcher

Hi All

       This is my code... i am  using  TextSwitcher.... i think  every
thing is fine but it is still throwing ClassCastException

switcher1 = (TextSwitcher) findViewById(R.id.switcher1);
                switcher2 = (TextSwitcher) findViewById(R.id.switcher2);

                switcher1.setFactory(new ViewSwitcher.ViewFactory() {
                        public View makeView() {
                                return score;
                        }
                });

                switcher2.setFactory(new ViewSwitcher.ViewFactory() {
                        public View makeView() {
                                return level;
                        }
                });


 This is the exception

 11-12 16:54:28.093: ERROR/AndroidRuntime(1609): Caused by:
java.lang.ClassCastException: android.widget.LinearLayout$LayoutParams

And it is occuring at

     switcher1.setFactory(new ViewSwitcher.ViewFactory() {
                        public View makeView() {
                                return score;
                        }
                });


     can any help me out please.....!!!!

Cheers,
Imran

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

2. android porting with nfs shut dowb VM err

I use pxa310 ,2.6.21 kernel, use USB ether net NFS
now the logcat is below,I do not know what should do now
please help me to start the Launcher APP,thanks

W/ActivityManager(  505): ShortMsg:Main thread not allowed to quit
W/ActivityManager(  505): LongMsg:java.lang.RuntimeException: Main
thread not allowed to quit
I/Process (  542): Sending signal. PID: 542 SIG: 9
D/AndroidRuntime(  544): Shutting down VM
W/dalvikvm(  544): threadid=3: thread exiting with uncaught exception
(group=0x40010e28)
E/AndroidRuntime(  544): Uncaught handler: thread main exiting due to
uncaught exception
E/AndroidRuntime(  544): java.lang.RuntimeException: Main thread not
allowed to quit
E/AndroidRuntime(  544):        at
android.os.MessageQueue.enqueueMessage(MessageQueue.java:177)
E/AndroidRuntime(  544):        at android.os.Looper.quit(Looper.java:
171)
E/AndroidRuntime(  544):        at android.app.ActivityThread
$H.handleMessage(ActivityThread.java:1622)
E/AndroidRuntime(  544):        at android.os.Handler.dispatchMessage
(Handler.java:88)
E/AndroidRuntime(  544):        at android.os.Looper.loop(Looper.java:
123)
E/AndroidRuntime(  544):        at android.app.ActivityThread.main
(ActivityThread.java:3742)
E/AndroidRuntime(  544):        at
java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(  544):        at java.lang.reflect.Method.invoke
(Method.java:515)
E/AndroidRuntime(  544):        at com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit
.java:739)
E/AndroidRuntime(  544):        at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:497)
E/AndroidRuntime(  544):        at dalvik.system.NativeStart.main
(Native Method)
W/ActivityManager(  505): Some application object
[EMAIL PROTECTED] tag AndroidRuntime has
 crashed, but I don't know who it .
W/ActivityManager(  505): ShortMsg:Main thread not allowed to quit
W/ActivityManager(  505): LongMsg:java.lang.RuntimeException: Main
thread not allowed to quit
I/Process (  544): Sending signal. PID: 544 SIG: 9

 
249,0-1      

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

3. Getting user's phone number

4. Simulate KeyEvent

5. Android compilation error with Sun SDK 1.6.0 Update 10

6. Jump 'n Run Game

7. data communication between emulator and localhost