Android : Network on main Thread with a Widget <p>I made a simple widget (<code>AppWidgetProvider</code>). To load its content, it needs to connect to the internet (<code>JSoup</code> is amazing). Obviously, I've got a wonderful <code>NetworkOnMainThreadException</code>. I tried to do an <code>AsyncTask</code> but Eclipse is shouting <code>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).</code> at me, so I can't run it.</p> <p>How could I solve it ?</p> <p>Thanks !</p>