package com.example.bcris;
import android.app.Service;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.IBinder;
public class mservice extends Service{
@Override
public IBinder onBind(Intent intent) {
// TODO Auto-generated method stub
return null;
}
@Override
public void onCreate() {
super.onCreate();
IntentFilter filter = new IntentFilter(Intent.ACTION_SCREEN_OFF);
BR r = new BR();
registerReceiver(r,filter);
IntentFilter filter2 = new IntentFilter(Intent.ACTION_SCREEN_ON);
BR r2 = new BR();
registerReceiver(r2,filter2);
}
}
---------------------------------------------------------------------------------------------
<service android:name="mservice" >
<intent-filter>
<action android:name="com.example.bcris.mservice" />
</intent-filter>
</service>
broadcast receiver, service,
沒有留言:
張貼留言