提出段階のver
This commit is contained in:
parent
75b4be9ff1
commit
235afb92cb
|
@ -158,6 +158,7 @@ public class TestService extends Service {
|
|||
}
|
||||
notificationManager.notify(R.string.app_name, builder.build());//通知の表示
|
||||
}
|
||||
|
||||
public void NotificationBluetooth(Context context) {//実際に通知を行うメソッド
|
||||
final String CHANNEL_ID = "my_channel_id";
|
||||
// 通知がクリックされたときに送信されるIntent
|
||||
|
@ -206,10 +207,6 @@ public class TestService extends Service {
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public void Bluetooth_status() {
|
||||
IntentFilter intentFilter = new IntentFilter();
|
||||
intentFilter.addAction(BluetoothDevice.ACTION_ACL_CONNECTED);
|
||||
|
@ -253,7 +250,6 @@ public class TestService extends Service {
|
|||
Log.d("BT", "Device connected");
|
||||
|
||||
|
||||
|
||||
Log.d("BT_Judge", "Registered: " + registeredId);
|
||||
|
||||
if (deviceHardwareAddress.equals(registeredId)) {
|
||||
|
@ -280,7 +276,8 @@ public class TestService extends Service {
|
|||
public void run() {
|
||||
if (BluetoothDevice.ACTION_ACL_DISCONNECTED.equals(action) && !isInCar) {//その後bluetoothを再接続したり降車状態になったりしていない=置き去りが発生した可能性大
|
||||
NotificationBluetooth(getApplicationContext());//通知を行うメソッド
|
||||
}}
|
||||
}
|
||||
}
|
||||
|
||||
}, 5 * 60 * 1000); // 5分をミリ秒に変換
|
||||
}
|
||||
|
@ -291,9 +288,6 @@ public class TestService extends Service {
|
|||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public IBinder onBind(Intent intent) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user