當應用程序崩潰這是我的服務類:Android的服務......讓敬酒
public class MySrv extends Service {
@Override
public void onCreate() {
// TODO Auto-generated method stub
super.onCreate();
final Context c = getApplicationContext();
Timer t = new Timer("mytimer");
TimerTask task = new TimerTask() {
@Override
public void run() {
// TODO Auto-generated method stub
Toast.makeText(c, "Not a beautyfull day today...", Toast.LENGTH_SHORT).show();
}
};
t.schedule(task, 5000, 6000);
}
@Override
public IBinder onBind(Intent intent) {
// TODO Auto-generated method stub
return null;
}
}
在Toast.makeText()的應用程序崩潰...所以我在做什麼錯?
請發表您的logcat輸出(logcat的視圖Eclipse或在shell'ADB logcat') – 2011-04-13 15:38:03
你肯定崩潰在Toast.makeText()?你嘗試調試嗎? – yogsma 2011-04-13 15:38:21