添加WinBoll类
This commit is contained in:
@@ -13,8 +13,8 @@ public class SOS {
|
||||
|
||||
public static final String TAG = "SOS";
|
||||
|
||||
public static void sendToWinBoll(Context context) {
|
||||
Intent intent = new Intent(context.getString(R.string.action_sos));
|
||||
public static void sosToWinBoll(Context context) {
|
||||
Intent intent = new Intent(WinBoll.ACTION_SOS);
|
||||
intent.putExtra("sosPackage", context.getPackageName());
|
||||
intent.putExtra("message", "SOS");
|
||||
String szToPackage = "";
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package cc.winboll.studio.libappbase;
|
||||
|
||||
/**
|
||||
* @Author ZhanGSKen@AliYun.Com
|
||||
* @Date 2025/02/15 12:14:45
|
||||
* @Describe WinBoll 类
|
||||
*/
|
||||
public class WinBoll {
|
||||
|
||||
public static final String TAG = "WinBoll";
|
||||
|
||||
public static final String ACTION_SOS = WinBoll.class.getName() + ".ACTION_SOS";
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package cc.winboll.studio.libappbase.receiver;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import cc.winboll.studio.libappbase.LogUtils;
|
||||
import cc.winboll.studio.libappbase.WinBoll;
|
||||
|
||||
/**
|
||||
* @Author ZhanGSKen@AliYun.Com
|
||||
* @Date 2025/02/15 12:17:32
|
||||
* @Describe WinBollReceiver
|
||||
*/
|
||||
public class WinBollReceiver extends BroadcastReceiver {
|
||||
|
||||
public static final String TAG = "WinBollReceiver";
|
||||
|
||||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
String action = intent.getAction();
|
||||
if(action.equals(WinBoll.ACTION_SOS)) {
|
||||
LogUtils.d(TAG, String.format("context.getPackageName() %s", context.getPackageName()));
|
||||
LogUtils.d(TAG, String.format("action %s", action));
|
||||
} else {
|
||||
LogUtils.d(TAG, String.format("action %s", action));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user