title: android-How to run Service in different thread than main thread?
body: <p>I am trying to develop a application in android that consists a service to read the sensor value for multiple hours. When i start the service my device get hang and all the other process is got slow. To solve this problem i have try to startservice in separate thread as given below but problem is still there.</p>
  
  <pre><code>    new Thread(new Runnable() {
  
                  @Override
                  public void run() {
                      Intent intent=new Intent(getApplicationContext(), SensorService.class);
                      startService(intent);
  
                  }
              }).start();
  </code></pre>
  
  <p>this thread only start the service in different thread but service run in main thread.
  Plz someone help me how to run service in separate thread ?</p>