title: How to stop remote service
body: <p>I have created a service and an activity. In that activity I have two buttons. One is to start service and another to stop service. I can start the remote activity by calling <code>startService()</code> but unable to stopr service using <code>stopService()</code>. If i click on start button I found extra remote process strarted  running (using eclipse ide). I am expecting if i click on stop button then that additional process shouls stop. but Its not happening. I am able to call start and stop service method successfully. To verify the code I have added a toast message in each start and stop method.  How to stop remote service?</p>
  
  <h2>My Activity</h2>
  
  <pre><code>public class SimpleServiceController extends Activity {
  
         @Override
          protected void onCreate(Bundle savedInstanceState) {
              super.onCreate(savedInstanceState);
              setContentView(R.layout.main);
  
              Button start = (Button)findViewById(R.id.serviceButton);
              Button stop = (Button)findViewById(R.id.cancelButton);
  
              start.setOnClickListener(startListener);
              stop.setOnClickListener(stopListener);
  
         }
  
         private OnClickListener startListener = new OnClickListener() {
          public void onClick(View v){
              startService(new Intent(SimpleServiceController.this,SimpleService.class));
          }               
         };
  
         private OnClickListener stopListener = new OnClickListener() {
              public void onClick(View v){
                  stopService(new Intent(SimpleServiceController.this,SimpleService.class));
              }               
            };
  }
  </code></pre>
  
  <h2>Service</h2>
  
  <pre><code>public class SimpleService extends Service {
  
      @Override
      public IBinder onBind(Intent arg0) {
          // TODO Auto-generated method stub
          return null;
      }
  
      @Override
      public void onCreate() {
          super.onCreate();
          Toast.makeText(this,"Service created ...", Toast.LENGTH_LONG).show();
      }
  
      @Override
      public void onDestroy() {
          super.onDestroy();
          Toast.makeText(this, "Service destroyed ...", Toast.LENGTH_LONG).show();
      }
  }
  </code></pre>
  
  <h2>Manifest</h2>
  
  <pre><code>&lt;service android:name=".SimpleService" android:process=":remote"&gt;
          &lt;/service&gt;
  </code></pre>