Commit 7190a9b9 authored by Grigory Fedorov's avatar Grigory Fedorov

New ShutDownReceiver. Should correctly exit app when phone shut down. Related to #471

parent 53daa1f3
......@@ -403,6 +403,15 @@
<action android:name="android.intent.action.BOOT_COMPLETED"/>
</intent-filter>
</receiver>
<receiver
android:name="com.xabber.android.receiver.ShutDownReceiver">
<intent-filter>
<action android:name="android.intent.action.ACTION_SHUTDOWN"/>
<action android:name="android.intent.action.QUICKBOOT_POWEROFF" />
</intent-filter>
</receiver>
<receiver android:name="com.xabber.android.receiver.GoAwayReceiver" />
<receiver android:name="com.xabber.android.receiver.GoXaReceiver" />
<receiver android:name="com.xabber.android.receiver.ComposingPausedReceiver" />
......
package com.xabber.android.receiver;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import com.xabber.android.data.Application;
public class ShutDownReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
Application.getInstance().requestToClose();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment