@@ -0,0 +1,1948 @@
+package info.hoang8f.autoap.widget;%0A%0Aimport android.content.BroadcastReceiver;%0Aimport android.content.Context;%0Aimport android.content.Intent;%0Aimport android.net.wifi.WifiConfiguration;%0Aimport android.net.wifi.WifiManager;%0Aimport android.util.Log;%0Aimport android.widget.RemoteViews;%0A%0Aimport java.lang.reflect.InvocationTargetException;%0Aimport java.lang.reflect.Method;%0A%0Aimport info.hoang8f.autoap.MainActivity;%0Aimport info.hoang8f.autoap.R;%0Aimport info.hoang8f.autoap.WifiAPUtils;%0A%0A/**%0A * Created by tranvu on 3/8/14.%0A */%0Apublic class WidgetBroadcastReceiver extends BroadcastReceiver %7B%0A    WifiAPUtils mWifiAPUtils;%0A%0A    @Override%0A    public void onReceive(Context context, Intent intent) %7B%0A        mWifiAPUtils = new WifiAPUtils(context);%0A        RemoteViews remoteViews = new RemoteViews(context.getPackageName(), R.layout.one_click_widget);%0A        if (intent.getAction().equals(WidgetProvider.TURN_ON_AP)) %7B%0A            Log.d(%22AP%22, %22On%22);%0A            mWifiAPUtils.setAP(true);%0A            remoteViews.setImageViewResource(R.id.widget_img, R.drawable.wifi_enabled);%0A            remoteViews.setOnClickPendingIntent(R.id.widget_img, WidgetProvider.clickToTurnOffAP(context));%0A        %7D else if (intent.getAction().equals(WidgetProvider.TURN_OFF_AP)) %7B%0A            mWifiAPUtils.setAP(false);%0A            mWifiAPUtils.enableWifi();%0A            remoteViews.setImageViewResource(R.id.widget_img, R.drawable.wifi_disabled);%0A            remoteViews.setOnClickPendingIntent(R.id.widget_img, WidgetProvider.clickToTurnOnAP(context));%0A        %7D else if (intent.getAction().equals(WidgetProvider.CHANGE_WIDGET_ON)) %7B%0A            remoteViews.setImageViewResource(R.id.widget_img, R.drawable.wifi_enabled);%0A        %7D else if (intent.getAction().equals(WidgetProvider.CHANGE_WIDGET_OFF)) %7B%0A            remoteViews.setImageViewResource(R.id.widget_img, R.drawable.wifi_disabled);%0A        %7D%0A        WidgetProvider.pushWidgetUpdate(context, remoteViews);%0A    %7D%0A%7D%0A

fix Widget state