title: Xamarin.Android: starting a new intent
body: <p>I was targeting android 4.4 and was starting a service like this</p>
  <pre><code>start.Click += delegate {
      StartService(new Intent(&quot;com.xamarin.LocationService&quot;));
      start.Enabled = false;
      stop.Enabled = true;
  };
  </code></pre>
  <p>and it all worked fine. Now I am targeting 6.0 and find from <a href="https://stackoverflow.com/questions/27842430/service-intent-must-be-explicit-intent">this thread</a> that this isn't secure, and I should do this:</p>
  <pre><code>Intent serviceIntent = new Intent(context,MyService.class);
  context.startService(serviceIntent);
  </code></pre>
  <p>but I cannot work out what the arguments for 'new Intent()' should be. The class name is 'LocationActivity' but if I do this</p>
  <pre><code>serviceIntent = new Intent(this, typeof(LocationActivity));
  context.startService(serviceIntent);
  </code></pre>
  <p>it compiles OK but the service doesn't actually start.</p>
  <p>The marked answer in that thread also suggests this</p>
  <pre><code>Intent bi = new Intent(&quot;com.android.vending.billing.InAppBillingService.BIND&quot;);
  bi.setPackage(&quot;com.android.vending&quot;);
  </code></pre>
  <p>but if I try that I find that 'Intent does not contain a  definition for setPackage'.</p>
  <p>So, can someone help me with a solution here? Thanks in advance.</p>