Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. @Override
  2. public void onCreate(Bundle savedInstanceState) {
  3. super.onCreate(savedInstanceState);
  4. setHasOptionsMenu(true);
  5. listAdapter = new ArrayAdapter<BluetoothDevice>(getActivity(), 0, listItems) {
  6. @Override
  7. public View getView(int position, View view, ViewGroup parent) {
  8. BluetoothDevice device = listItems.get(position);
  9. if (view == null)
  10. view = getActivity().getLayoutInflater().inflate(R.layout.device_list_item, parent, false);
  11. TextView text1 = view.findViewById(R.id.text1);
  12. TextView text2 = view.findViewById(R.id.text2);
  13. text1.setText(device.getName());
  14. text2.setText(device.getAddress());
  15. return view;
  16. }
  17. };
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement