title: sending Activity to Back and Front
body: <p>I have many Activities in my android Application and SMS Service that runs in background.</p>
  
  <p>My main Activity is <code>ZigbeeActivity.java</code> on which I have an Exit Button when I got click on Exit I want to application sent to background for doing this I use <code>MoveTaskToBack</code> method and now my smsService is running at background which receives sms but when I run my Zigbee Activity again from my application installed on Device it gets started, but does not show any data hold on it I think it will start new Zigbee application. Can anyone tell me how I can call my application on foreground?</p>
  
  <p>The code of onCreate Method to start service.</p>
  
  <pre><code>@Override
  public void onCreate(Bundle savedInstanceState) {
  
      super.onCreate(savedInstanceState);
      try{
      setContentView(R.layout.main);
              startService(new Intent(this,SmsService.class));
      }catch(Exception e){}
  
  }
  </code></pre>
  
  <p>this is the code for sending activity to background</p>
  
  <p>case R.id.btnExit:</p>
  
  <pre><code>            ConstantClass.Clear_Main_Screen = false;
              moveTaskToBack(true);
              break;
  </code></pre>