How could the app run normal after the screen locked in android
<p>I create a server, and there is a thread in the server. But when the screen is locked, it can not run normal.</p>

<pre><code>package org.omagic;

import org.omagic.service.PhoneService;
 ....

public class TService extends Service {
 public Handler han = new Handler()
 {
 @Override
 public void handleMessage(Message msg) {
 super.handleMessage(msg);
 }
 };

 public IBinder onBind(Intent intent) 
 {
 return null;
 }

@Override
 public void onDestroy() {
 super.onDestroy();
 }

 @Override
 public void onCreate() {
 super.onCreate(); 
t = new Thread(new Runnable() {
 public void run() {
 while (true) {
                                    //do some execution code
                                         //Perform a stop for a period of time
        Thread.sleep(30000);    
 } 
}
 });
 t.start();
 }
 }
</code></pre>

<p>When the software starts and login in, the service is start by calling the below method.</p>

<pre><code>Intent i2 = new Intent();
 i2.setClass(c, TService.class);
 TService.tims = 2000;
 TService.key = "111";
 c.stopService(i2);
 c.startService(i2);
</code></pre>

<p>It can run normally. But after the screen locked, it can not run.
How could it run normally after lock screen?</p>
