Bluetoothデバイスを保存する機能を追加
This commit is contained in:
1 parent
a69de31fa2
commit
6fe06fbf48
6 files changed
+49
-24
No files matched your search
@@ -1,21 +0,0 @@
|
||||
package com.example.childguard;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.preference.PreferenceManager;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
public class Bluetooth_device_save extends AppCompatActivity {
|
||||
final SharedPreferences pref= PreferenceManager.getDefaultSharedPreferences(this);
|
||||
public Bluetooth_device_save() {
|
||||
}
|
||||
public void device_save(String deviceAddress){
|
||||
SharedPreferences.Editor e=pref.edit();
|
||||
e.putString("bluetooth_device1",deviceAddress);
|
||||
e.apply();
|
||||
}
|
||||
public String device_info(){
|
||||
return pref.getString("bluetooth_device1","not_device");
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user