2

I want to use ListView on earlier versions of Android within an AppWidget.
RagnarRs answer in this question suggests that he achieved that via the support library, but he didn't explain how he did it exactly.

Does anybody know what he's talking about?

Community
  • 1
  • 1
Jr.
  • 126
  • 1
  • 10

2 Answers2

5

I want to use ListView on earlier versions of Android within an AppWidget.

This is not possible. ListView only works in an app widget starting with API Level 11.

RagnarRs answer in this question suggests that he achieved that via the support library, but he didn't explain how he did it exactly.

RagnarRs is very confused.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
0

What do you mean by earlier versions? Can't you just do this Implement ListView in android Widgets

Looking into the support library I see there is the CursorAdapter which provides compatibility with thew android 3.0+ methods/constructors.

Community
  • 1
  • 1
Matt Wolfe
  • 8,924
  • 8
  • 60
  • 77
  • Yep, I want to use a listView in a app widget on froyo, eclair for example, but i always get "inflating appWidget" error error.. I tried so much do like RagnarR! with ICS emulator i have no problem with my appWidget – Jr. Jun 14 '12 at 19:21
  • Ok so if you are using the android support library, change your imports (where necessary) to use those from the support library. See this page http://developer.android.com/training/basics/fragments/support-lib.html Basically just change your import to use android.support.v4.x.y.Z; Are you using CursorAdapter or other classes that are in the support library? – Matt Wolfe Jun 14 '12 at 19:25
  • Also, to use the android support library, get the jar file and put it in your libs folder. If you are using eclipse, tell eclipse to add that jar to your build path. – Matt Wolfe Jun 14 '12 at 19:26
  • I don't have 'anything' on my classes, just necessarily to run. I just have my xml Widget_Layout, and if I put a listView on it i get an error(on versions -3.0 try it). So how import if i 'dont have classes'? I tryed use support-v4 and read googles documentations but just reference jar doesn't work. tks – Jr. Jun 14 '12 at 19:33