如何检查广​​播接收器是否正常工作?

时间:2014-08-08 06:13:03

标签: android android-broadcast

这是bootstartup.java文件。我已经检查过TestService是否正常工作。但我只是想知道如何检查数据是否被广播?

代码

public class bootstartup extends BroadcastReceiver {  

    @Override  
    public void onReceive(Context context, Intent intent) {  
        // TODO Auto-generated method stub  
        // start the service  
        Intent service=new Intent(context,TestService.class);                      
        context.startService(service);                    
        Log.e("com.example.myglobalbroadcastreceiver","Broadcast Received:"+intent.getAction());                         

        // start the app               
        Intent app= new Intent(context,Abhijeet.class);  
        context.startService(app);             
    }  
}   

0 个答案:

没有答案