title: how to put an onclick listener inside of a Service
body: <p>i tried to put this <code>onClick</code> Listener inside of a Service to register clicks from a <code>button</code> in a custom <code>xml</code> view that is inside of a notification bar.   But the <code>onClickListener</code> gets complier error.  Does anyone know why the compile error is there?</p>
  
  <pre><code>   RemoteViews remoteviews = new RemoteViews("com.example.test", R.layout.custom_notifications);
  
       NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(AudioService.this)
                 .setContent(remoteviews)
                  .setSmallIcon(R.drawable.ic_launcher)
                  .setContentTitle("My notification")
                  .setContentText("Hello World!")
                  .setOngoing(true);
  
  
  
       remoteviews.setOnClickListener(new View.OnClickListener() {
  
              public void onClick(View v) {
  
          Toast.makeText(AudioViewer.this, "play button was clicked", Toast.LENGTH_LONG).show();
              }
          });
  </code></pre>
  
  <p>Error from the complier is shown as in the below image:</p>
  
  <p><img src="https://i.stack.imgur.com/XOElv.png" alt="enter image description here"></p>