更改提示文字

master
张萌 3 years ago
parent a1ea5114ac
commit 80ca78fd89

@ -47,13 +47,12 @@ public class DjScanerPlugin implements FlutterPlugin, MethodCallHandler {
}
};
}
;
private BroadcastReceiver scanReceiver;
@Override
public void onListen(Object arguments, EventChannel.EventSink events) {
System.out.println("注册广播");
System.out.println("开始监听扫描");
scanReceiver = createScanReceiver(events);
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction(SCANACTION);
@ -63,7 +62,7 @@ public class DjScanerPlugin implements FlutterPlugin, MethodCallHandler {
@Override
public void onCancel(Object arguments) {
System.out.println("注销广播");
System.out.println("结束监听扫描");
context.unregisterReceiver(scanReceiver);
}
});
@ -109,8 +108,7 @@ public class DjScanerPlugin implements FlutterPlugin, MethodCallHandler {
call.method.equals("scanEnabled")
) {
boolean arg=(boolean) call.argument("onOpen");
System.out.println("扫描开关:");
System.out.println(arg);
System.out.println("扫描开关:"+(arg?"开启":"关闭"));
Intent intent = new Intent("com.android.scanner.ENABLED");
intent.putExtra("enabled",arg);
context.sendBroadcast(intent);

@ -29,7 +29,6 @@ class DjScaner {
}
static Future init() async {
print('初始化');
///
await soundPlay(false);
@ -45,7 +44,7 @@ class DjScaner {
///
await scanEnabled(false);
print('初始化完成');
print('扫描初始化完成');
}
///

Loading…
Cancel
Save