title: System services not available to Activities before onCreate()
body: <p>I'm getting this exception System services not available to Activities before <code>onCreate()</code> when I'm trying to set adapter outside of my <code>onCreate()</code> method.
  <br>I have tried using <code>runOnUIThread()</code> function but still couldn't solve my problem.<br>Here is my code actually.<br> I'm sending a list from my Service subclass to my activity class via a method. </p>
  
  <pre><code>Class KitchenSerivce extends Service
  @Override
  public int onStartCommand(Intent intent, int flags , int startId)
  {   
      super.onStartCommand(intent, flags, startId);   
      Toast.makeText(this, "Service started ...", Toast.LENGTH_SHORT).show();
  
      try
      {
          SoapObject result=null;
          SoapObject request=new SoapObject(NAME_SPACE, METHOD_NAME);
  
          SoapSerializationEnvelope envelope=new SoapSerializationEnvelope(SoapEnvelope.VER11);
          envelope.dotNet=true;
          envelope.setOutputSoapObject(request);
  
          try
          {
              HttpTransportSE androidHttpTransportSE=new HttpTransportSE(URL, 5000);
              androidHttpTransportSE.call(SOAP_ACTION, envelope);
  
              result=(SoapObject)envelope.getResponse();
              orderList=getOrder(result);
  
              Log.v("Server response", result.toString());
          }
          catch (Exception e)
          {
              msg=Toast.makeText(this, "Connection to Server Failed", Toast.LENGTH_SHORT);
              msg.show();             
          }
  
          msg=Toast.makeText(this, result.toString(), Toast.LENGTH_SHORT);
          msg.show();
  
          KitchenManager kitchen=new KitchenManager();        
          kitchen.sendOrder(orderList);
      }                   
      catch (Exception e)     
      {               
          System.out.println("Exception Caught:"+e.getMessage());         
      }
  
      return START_STICKY;        
  }
  </code></pre>
  
  <hr>
  
  <p><strong>KitchenManager extends Activity</strong></p>
  
  <pre><code>public void sendOrder(List&lt;Order&gt; orderList)
  {
  
      this.orderList=orderList;
  
      for(int i=0;i&lt;orderList.size();i++)
      {
          System.out.println("List Size:"+orderList.size());
          System.out.println("Item:"+orderList.get(i).getItem());
      }
  
      adapter=new OrdersAdapter(KitchenManager.this,R.layout.kitchen_order_list,this.orderList);
  
      if(this.orderList.size()==0)
      {
  
      }
      else
      {
      list.setAdapter(adapter);
      adapter.notifyDataSetChanged();
      }
  }
  </code></pre>
  
  <hr>
  
  <p>I'm getting exception in public void <code>sendOrder()</code> on line </p>
  
  <pre><code>adapter=new OrdersAdapter(KitchenManager.this,R.layout.kitchen_order_list,this.orderList);
  </code></pre>
  
  <p>Please if any one could help me because I'm done searching but can't find solution to my problem. Thanks in advance.</p>