ListActivity does the ArrayAdapter<T> class have to be an Inner Class

by David Parry » Fri, 23 Apr 2010 08:03:42 GMT


Sponsored Links
 Question:

I have a Concrete class that implements ListActivity in this class I
have an InnerClass extends ArrayAdapter<T>. This came from an example
and works great i.e. displays my list of items on the screen.

The problem is that I tried pulling out the InnerClass and use it as a
standalone Concrete class. So now I pass in the array of Items i.e T[]
to the constructor but when I set the ListActivity classes
setListAdapter(my pulled out InnerClass); the screen comes up empty?

So is this by design that ArrayAdapter has to be an InnerClass in the
ListActivity class?

If no then how can i get the list to display and update.

Thank you,
David

--



Other Threads

1. Automate Google Maps on Android

I posted a blog on test automation example of 'Google Maps' on android
emulator
http://auto-simple.blogspot.com/2010/03/automate-google-maps-on-android.html

-- 

2. apply theme over setting application wide

Hi all.

I want to apply theme over setting application wide.


So I implemented below code but there was no effect. Please give me
help.


1. AndroidMenifest.xml


    <application android:label="@string/settings_label"
            android:icon="@drawable/ic_launcher_settings"
            android:theme="@android:style/Widget.ListView"
            android:taskAffinity="">
            -> added Widget.ListView style provided in android system
                and I changed style.xml file like below


2. FrameWork/base/core/res/res/values/styles.xml


    before change : <item
name="android:listSelector">@android:drawable/
list_selector_background</item>


    After change:
    <style name="Widget.ListView" parent="Widget.AbsListView">
        <item name="android:listSelector">@android:drawable/
list_selector_background_gradation</item>
        <item name="android:cacheColorHint">?android:attr/
colorBackgroundCacheHint</item>
        <item name="android:divider">@android:drawable/
divider_horizontal_dark_opaque</item>


3. FrameWork/base/core/res/res/drawable/
list_selector_background_gradation.xml


    -> I made list_selector_background_gradation.xml with below code.
        But those are really same to list_selector_background.xml and
just have XXX_gradation.


<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_window_focused="false"
        android:drawable="@color/transparent" />
    <!-- Even though these two point to the same resource, have two
states so the drawable will invalidate itself when coming out of
pressed state. -->
    <item android:state_focused="true" android:state_enabled="false"
        android:state_pressed="true"
        android:drawable="@drawable/
list_selector_background_disabled_gradation" />
    <item android:state_focused="true" android:state_enabled="false"
        android:drawable="@drawable/
list_selector_background_disabled_gradation" />
    <item android:state_focused="true" android:state_pressed="true"
        android:drawable="@drawable/
list_selector_background_transition_gradation" />
    <item android:state_focused="false" android:state_pressed="true"
        android:drawable="@drawable/
list_selector_background_transition_gradation" />
    <item android:state_focused="true"
        android:drawable="@drawable/
list_selector_background_focus_gradation" />
</selector>


4. FrameWork/base/core/res/res/drawable/
list_selector_background_transition_gradation.xml
    -> I made list_selector_background_transition_gradation.xml with
below code.
        But those are really same to
list_selector_background_transition.xml and just have XXX_gradation.


<transition xmlns:android="http://schemas.android.com/apk/res/
android">
    <item android:drawable="@android:drawable/
list_selector_background_pressed_gradation"  />
    <item android:drawable="@android:drawable/
list_selector_background_longpress_gradation"  />
</transition>


5. add image files
    -> I added new image files like below.


FrameWork/base/core/res/res/drawable-hdpi/
list_selector_background_disabled_gradation.9.png
FrameWork/base/core/res/res/drawable-hdpi/
list_selector_background_focus_gradation.9
FrameWork/base/core/res/res/drawable-hdpi/
list_selector_background_longpress_gradation.9
FrameWork/base/core/res/res/drawable-hdpi/
list_selector_background_pressed_gradation.9


And I do full build and expect to change background image in the
setting application but I couldn't


Please help me and let me know what is problem.


Thanks in advance
Mycall.


-- 
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

3. PPPD and AT commands.

4. Positioning/Layout of the Input Method / Soft Keyboard

5. Move the virtual keyboard to the top of the screen (SIP - IME)

6. Protocol exception : too many redirects

7. getHitRect - Android 1.5