Skip to content
Snippets Groups Projects
Commit 33992c74 authored by Harrion VENIER's avatar Harrion VENIER
Browse files

add var name device for save to bdd

parent 04f618e2
No related merge requests found
...@@ -41,6 +41,7 @@ public class SendActivity extends AppCompatActivity { ...@@ -41,6 +41,7 @@ public class SendActivity extends AppCompatActivity {
SendActivity myApp = this; SendActivity myApp = this;
ListView listView; ListView listView;
ClientClass clientClass; ClientClass clientClass;
String[] nameDevice;
String test ="yolo"; String test ="yolo";
byte[] imageData; byte[] imageData;
...@@ -108,7 +109,7 @@ public class SendActivity extends AppCompatActivity { ...@@ -108,7 +109,7 @@ public class SendActivity extends AppCompatActivity {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
Set<BluetoothDevice> bt=bluetoothAdapter.getBondedDevices(); Set<BluetoothDevice> bt=bluetoothAdapter.getBondedDevices();
String[] strings=new String[bt.size()]; nameDevice=new String[bt.size()];
btArray=new BluetoothDevice[bt.size()]; btArray=new BluetoothDevice[bt.size()];
int index=0; int index=0;
...@@ -118,11 +119,11 @@ public class SendActivity extends AppCompatActivity { ...@@ -118,11 +119,11 @@ public class SendActivity extends AppCompatActivity {
{ {
btArray[index]= device; btArray[index]= device;
System.out.println(btArray[index]); System.out.println(btArray[index]);
strings[index]=device.getName(); nameDevice[index]=device.getName();
index++; index++;
} }
ArrayAdapter<String> arrayAdapter=new ArrayAdapter<String>(myApp.getApplicationContext(),android.R.layout.simple_list_item_1,strings); ArrayAdapter<String> arrayAdapter=new ArrayAdapter<String>(myApp.getApplicationContext(),android.R.layout.simple_list_item_1,nameDevice);
listView.setAdapter(arrayAdapter); listView.setAdapter(arrayAdapter);
} }
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment