Android broadcast receiver not receiving intent

My problem was solved when I removed the receiver unregister from the OnPause(). method.


Try it again like this. The category may need to be added

<receiver
    android:name = "LogReceiver"
    android:enabled="true">
    <intent-filter>
        <action android:name="com.me.intent.finishlog" />
         <category android:name="android.intent.category.DEFAULT"/> 
    </intent-filter>
</receiver>

something like:

public void onResume() {
    IntentFilter filter = new IntentFilter();
    getActivity().registerReceiver(mLogReceiver,filter);
}

and for un-register:

public void onPause() {
    getActivity().unregsiterReceiver(mLogreceiver);
}

edit: i just figured that your LogReceiver-class has no constructor neither. you will need to write one aswell:

private LogReceiver mLogReceiver = new LogReceiver() {

and after that you can use the onReceive-method like you have it already in your code.