添加WinBoll类
This commit is contained in:
parent
8d2b325172
commit
bbac0c7306
@ -1,8 +1,8 @@
|
|||||||
#Created by .winboll/winboll_app_build.gradle
|
#Created by .winboll/winboll_app_build.gradle
|
||||||
#Sat Feb 15 03:29:17 GMT 2025
|
#Sat Feb 15 04:45:53 GMT 2025
|
||||||
stageCount=2
|
stageCount=2
|
||||||
libraryProject=libappbase
|
libraryProject=libappbase
|
||||||
baseVersion=1.5
|
baseVersion=1.5
|
||||||
publishVersion=1.5.1
|
publishVersion=1.5.1
|
||||||
buildCount=91
|
buildCount=97
|
||||||
baseBetaVersion=1.5.2
|
baseBetaVersion=1.5.2
|
||||||
|
@ -65,6 +65,7 @@
|
|||||||
android:name="android.max_aspect"
|
android:name="android.max_aspect"
|
||||||
android:value="4.0"/>
|
android:value="4.0"/>
|
||||||
|
|
||||||
|
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
|
@ -77,7 +77,7 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void onSOS(View view) {
|
public void onSOS(View view) {
|
||||||
SOS.sendToWinBoll(this);
|
SOS.sosToWinBoll(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
// public void sos() {
|
// public void sos() {
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
#Created by .winboll/winboll_app_build.gradle
|
#Created by .winboll/winboll_app_build.gradle
|
||||||
#Sat Feb 15 03:29:17 GMT 2025
|
#Sat Feb 15 04:45:53 GMT 2025
|
||||||
stageCount=2
|
stageCount=2
|
||||||
libraryProject=libappbase
|
libraryProject=libappbase
|
||||||
baseVersion=1.5
|
baseVersion=1.5
|
||||||
publishVersion=1.5.1
|
publishVersion=1.5.1
|
||||||
buildCount=91
|
buildCount=97
|
||||||
baseBetaVersion=1.5.2
|
baseBetaVersion=1.5.2
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
<service android:name=".SimpleOperateSignalCenterService"
|
<service android:name=".SimpleOperateSignalCenterService"
|
||||||
android:exported="true">
|
android:exported="true">
|
||||||
</service>
|
</service>
|
||||||
|
|
||||||
<activity android:name=".LogActivity"/>
|
<activity android:name=".LogActivity"/>
|
||||||
|
|
||||||
<receiver android:name=".receiver.MyBroadcastReceiver">
|
<receiver android:name=".receiver.MyBroadcastReceiver">
|
||||||
@ -30,6 +30,17 @@
|
|||||||
</intent-filter>
|
</intent-filter>
|
||||||
</receiver>
|
</receiver>
|
||||||
|
|
||||||
|
<receiver android:name="cc.winboll.studio.libappbase.receiver.WinBollReceiver"
|
||||||
|
android:exported="true">
|
||||||
|
|
||||||
|
<intent-filter>
|
||||||
|
|
||||||
|
<action android:name="cc.winboll.studio.libappbase.WinBoll.ACTION_SOS"/>
|
||||||
|
|
||||||
|
</intent-filter>
|
||||||
|
|
||||||
|
</receiver>
|
||||||
|
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
|
@ -13,8 +13,8 @@ public class SOS {
|
|||||||
|
|
||||||
public static final String TAG = "SOS";
|
public static final String TAG = "SOS";
|
||||||
|
|
||||||
public static void sendToWinBoll(Context context) {
|
public static void sosToWinBoll(Context context) {
|
||||||
Intent intent = new Intent(context.getString(R.string.action_sos));
|
Intent intent = new Intent(WinBoll.ACTION_SOS);
|
||||||
intent.putExtra("sosPackage", context.getPackageName());
|
intent.putExtra("sosPackage", context.getPackageName());
|
||||||
intent.putExtra("message", "SOS");
|
intent.putExtra("message", "SOS");
|
||||||
String szToPackage = "";
|
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));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user