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. OutOfMemoryError from BitmapFactory

Like many others here I'm getting OutOfMemoryError from BitmapFactory
when decoding multiple bitmaps.
I am sure I am not leaking memory. Here is the system log from a
crash:

I/dalvikvm-heap(  501): Grow heap (frag case) to 8.731MB for 1357499-
byte allocation
I/ActivityManager(   82): Process com.android.vending (pid 333) has
died.
D/dalvikvm(  501): GC freed 7 objects / 248 bytes in 164ms
D/CameraService(   32): getParameters
V/QualcommCameraHardware(   32): getParameters: EX
E/Camera  (  501): _getParameters: antibanding=auto;antibanding-
values=off,50hz,60hz,auto;effect-
values=mono,negative,solarize,pastel,mosaic,resize,sepia,posterize,whiteboard,blackboard,aqua;jpeg-
quality=100;jpeg-thumbnail-height=384;jpeg-thumbnail-quality=30;jpeg-
thumbnail-width=512;luma-adaptation=0;nightshot-mode=0;picture-
format=jpeg;picture-size=2048x1536;preview-format=yuv422sp;preview-
frame-rate=15;preview-
size=480x320;rotation=0;whitebalance=auto;whitebalance-
values=auto,custom,incandescent,fluorescent,daylight,cloudy,twilight,shade
D/dalvikvm(  501): GC freed 204 objects / 1415776 bytes in 140ms
E/dalvikvm-heap(  501): 778240-byte external allocation too large for
this process.
E/        (  501): VM won't let us allocate 778240 bytes
D/skia    (  501): xxxxxxxxxxxxxxxxxxxx allocPixelRef failed
W/dalvikvm(  501): threadid=15: thread exiting with uncaught exception
(group=0x
4000fe68)
E/AndroidRuntime(  501): Uncaught handler: thread Thread-8 exiting due
to uncaught exception
E/AndroidRuntime(  501): java.lang.OutOfMemoryError: bitmap size
exceeds VM budget

As you can see the heap was just grown to 8.731 MB, which is much less
than the 16 MB allowed, and much less than the maximum memory this
same program has routinely used -- over 10 MB. Just prior to the
failed allocation of 778,240 bytes GC freed 1,415,776 bytes. So there
should be plenty of memory available.
I am scrupulously recycling bitmaps nulling pointers, etc.
Any ideas what's going on, or for a workaround?
--~--~---------~--~----~------------~-------~--~----~

2. pretty great idea

hey developers,

i have a preposition for anybody that is fairly good at programming
and wants to make a name on the android market. personally, i have no
experience whatsoever in developing any type of program. although, i
do believe that if somebody was able to turn my basic idea into
reality, they would be able to make quite a few dollars, or at least
receive some major props.

im not asking for any money. i just want to see this program, and have
it on my g1. and maybe have my name and a picture of me flash at the
intro ;).

so yea, please email me if you want the details of the idea.
seriously, what do you have to lose.

thanks
mjrtom

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

3. Anyone been asked by dev to change their rating for their app on market?

4. SurfaceFlinger and permitions

5. How to create two TextView without write the XML file?

6. UK Sales of the G1

7. Android 1.5: Problems developing on a device