I have the content module loaded, the specific error I\'m getting is: The constructor Intent(new View.OnClickListener(){}, Class
Change this:
new Intent(this, ContactWidget.class);
to
new Intent(ContactWidget.this, ContactWidget.class);
The error happens because, in that case, this
is referencing the instance of OnClickListener
, but the Intent's
constructor expects a Context
. The context you have to pass is the reference to the activity itself, thus you have to access it explicitly using ContactWidget.this
.
The context passed in could be from a remote application host... apparently you need the app context from your app, the one with your class (your broadcast reciever for instance). Intent intent = new Intent(context.getApplicationContext(), WidgetryBroadcastReceiver.class); instead of Intent intent = new Intent(context, WidgetryBroadcastReceiver.class); go figure.
yeah that workerd for me aswell for the error in
Geocoder gc = new Geocoder(this, Locale.getDefault());