当应用程序崩溃这是我的服务类: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