Android Open Source - Volume-Setter Widget Intent Receiver






From Project

Back to project page Volume-Setter.

License

The source code is released under:

GNU General Public License

If you think the Android project Volume-Setter listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package fr.android.volumesetter;
/*from   w w w.  j  a va2  s .com*/
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.widget.RemoteViews;


public class WidgetIntentReceiver extends BroadcastReceiver {

  @Override
  public void onReceive(Context context, Intent intent) {
    if(intent.getAction().equals("volumesetter.action.LOAD_CONFIG")){
      updateWidgetPictureAndButtonListener(context);
    }
  }

  private void updateWidgetPictureAndButtonListener(Context context) {
    RemoteViews remoteViews = new RemoteViews(context.getPackageName(), R.layout.layout_widget);
    MainActivity.widgetLoadBoolean(context);
    
    remoteViews.setOnClickPendingIntent(R.id.widget_image, WidgetProvider.buildButtonPendingIntent(context));
    WidgetProvider.pushWidgetUpdate(context.getApplicationContext(), remoteViews);
  }



}




Java Source Code List

fr.android.volumesetter.GlobalApp.java
fr.android.volumesetter.MainActivity.java
fr.android.volumesetter.SharedPref.java
fr.android.volumesetter.WidgetIntentReceiver.java
fr.android.volumesetter.WidgetProvider.java