title: java.lang.SecurityException: Not allowed to start service Intent
body: <p>hey all when installing my app to the emulator I get this:</p>
  
  <blockquote>
    <p>ERROR/AndroidRuntime(465): java.lang.RuntimeException: Unable to start receiver com.myPackage.Widget.MYWidget: java.lang.SecurityException: Not allowed to start service Intent { cmp=com.myPackage/.Widget.MYWidget$MyWidgetService } without permission android.permission.BIND_REMOTEVIEWS</p>
  </blockquote>
  
  <p>here is the code from my manifest</p>
  
  <pre><code>    &lt;!-- Broadcast Receiver that will process AppWidget updates --&gt;
      &lt;receiver android:name=".Widget.MYWidget" android:label="@string/app_name"&gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.appwidget.action.APPWIDGET_UPDATE" /&gt;
  
              &lt;!--Broadcast Receiver that will also process our self created action --&gt;
              &lt;action android:name="com.temp.package.Widget.MYWidget.ACTION_WIDGET_LEFT_RECEIVER" /&gt;
  
  
              &lt;action android:name="com.temp.package.Widget.MYWidget.ACTION_WIDGET_PROGRESSBAR_RECEIVER" /&gt;
          &lt;/intent-filter&gt;
          &lt;meta-data android:name="android.appwidget.provider"
              android:resource="@xml/mywidget_widget_provider" /&gt;
  
      &lt;/receiver&gt;
      &lt;service android:name=".Widget.MYWidget$MyWidgetService"
          android:permission="android.permission.BIND_REMOTEVIEWS"
          android:exported="true"  /&gt;
          &lt;uses-permission
      android:name="android.permission.BIND_REMOTEVIEWS"&gt;&lt;/uses-permission&gt;
  </code></pre>
  
  <p>this is my code</p>
  
  <pre><code>public class MyWidget extends AppWidgetProvider {
  @Override
  public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
  
      Intent svcIntent = new Intent(context, MyWidgetService.class);
  
      //svcIntent.setData(Uri.parse(svcIntent.toUri(Intent.URI_INTENT_SCHEME)));
      context.startService(svcIntent);
  }
  
  public static class MyWidgetService extends Service
  {
      @Override
      public void onStart(Intent intent, int startId)
      {
          super.onStart(intent, startId);
          // Update the widget
          RemoteViews remoteView = buildRemoteView(this);
  
          // Push update to homescreen
          pushUpdate(remoteView);
  
          // No more updates so stop the service and free resources
          stopSelf();
      }
  
      public RemoteViews buildRemoteView(Context context)
      {
          RemoteViews remoteViews = new RemoteViews(context.getPackageName(), R.layout.widget_layout);
  
          //do stuff
  
  
          return remoteViews;
      }
  
      @Override
      public void onConfigurationChanged(Configuration newConfig)
      {
          int oldOrientation = this.getResources().getConfiguration().orientation;
  
          if(newConfig.orientation != oldOrientation)
          {
              // Update the widget
              RemoteViews remoteView = buildRemoteView(this);
  
              // Push update to homescreen
              pushUpdate(remoteView);
          }
      }
  
      private void pushUpdate(RemoteViews remoteView)
      {
          ComponentName myWidget = new ComponentName(this, MyWidget.class);
          AppWidgetManager manager = AppWidgetManager.getInstance(this);
          manager.updateAppWidget(myWidget, remoteView);
      }
  
      @Override
      public IBinder onBind(Intent arg0)
      {
          // TODO Auto-generated method stub
          return null;
      }
  }
  </code></pre>