I created a home screen widget (1*1) and I am trying to open the intent chooser for the camera and the gallery from that widget. I tried opening intent chooser from other class but it's not working. Here is the code from my configuration activity:
Intent clickIntent = new Intent(ConfigurationActivity.this, WidgetProviderSmall.class);
clickIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, mAppWidgetId);
PendingIntent pendingIntent = PendingIntent.getBroadcast(ConfigurationActivity.this, mAppWidgetId, clickIntent, 0);
views.setOnClickPendingIntent(R.id.img_widget, pendingIntent);
appWidgetManager.updateAppWidget(mAppWidgetId, views);
This is from my AppWidgetProvider class:
@Override
public void onReceive(Context context, Intent intent) {
if (intent.getAction()==null) {
Bundle extras = intent.getExtras();
if(extras!=null) {
class.OpenIntentChooser();
}
}
else {
super.onReceive(context, intent);
}
}
Any suggestions?