new Thread(new Runnable() {
            @Override
            public void run() {
                while (ct<1) {                    try {
                        Thread.sleep(1000);
                        ct++;
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                    count++;
                    Log.v("CountService", "Count is " + count);
                    //发送广播
                    Intent intent=new Intent();
                    intent.putExtra("count", count);
                    intent.setAction("com.ljq.activity.CountService");
                    sendBroadcast(intent);
                    Log.v("CountService", "Count is " + count);
                }
            }
        }).start();
           Intent intent=new Intent();
                    intent.putExtra("count", count);
                    intent.setAction("com.ljq.activity.CountService");
                    sendBroadcast(intent);//这样就会失败