の開始に問題がありService
ます。アプリケーションが起動する前にクラッシュします。
Intent repSer = new Intent(this,repService.class);
startService(repSer);
これService
自体です。:
public class repService extends Service {
@Override
public void onCreate() {
// TODO Auto-generated method stub
super.onCreate();
while(true){
Thread timer = new Thread(){
public void run(){
try {
sleep(5000);
// do something
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} finally {
// do something
}
}
};
timer.start();
}
}
}
おそらくこれは間違っていますか?私のマニフェストエントリ:
<service android:name = ".repService"/>
</application>