I made a simple widget (AppWidgetProvider
). To load its content, it needs to connect to the internet (JSoup
is amazing). Obviously, I've got a wonderful NetworkOnMainThreadException
. I tried to do an AsyncTask
but Eclipse is shouting No enclosing instance of type WidgetClass is accessible. Must qualify the allocation with an enclosing instance of type WidgetClass (e.g. x.new A() where x is an instance of WidgetClass).
at me, so I can't run it.
How could I solve it ?
Thanks !