Android Widget Button Click Toast Maessage

I’ve created a simple widget have only a button and textView. When I add my widget first time to the homescreen a FC message coming and widget will added. And button click toast message won’t work. Only i need to have a toast message when clicking the widget button. I’ve gone through lots of tutorials but couldn’t figure out whats the problem. Any genius who’d like to help..really appriciate the help..Thanks..

public class widgetProvider extends AppWidgetProvider{

public void onUpdate(Context context, AppWidgetManager appWidgetManager,
        int[] appWidgetIds) {
    final int N = appWidgetIds.length;

    for (int i=0; i<N; i++) {
        int appWidgetId = appWidgetIds[i];

        Intent intent = new Intent(context, widgetProvider.class);
        PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 0, intent, 0);

        RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widgetlayout);
        views.setOnClickPendingIntent(, pendingIntent);

        appWidgetManager.updateAppWidget(appWidgetId, views);
    public void onReceive(Context context, Intent intent) {

        if (intent.getAction().equals(AppWidgetManager.ACTION_APPWIDGET_UPDATE)) {
            Toast.makeText(context, "Button Clicked", Toast.LENGTH_SHORT).show();



    android:theme="@style/AppTheme" >

    <receiver android:name=".widgetProvider" android:label="@string/app_name">
        <intent-filter >
                android:name="android.appwidget.action.APPWIDGET_UPDATE" />

            android:resource="@xml/widgetprovider" />



your onUpdate is never called since you overriden the onReceive method.