Advertisement
Mazle

DeviceListFragment

Jun 26th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. public class DeviceListFragment extends ListFragment {
  2.  
  3. ArrayList<LaboratoryDevice> deviceArrayList;
  4.  
  5. @Override
  6. public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
  7. Log.v("Begin",new Date()+ "starting createView for DeviceListFragment");
  8. return inflater.inflate(R.layout.content_activity_fragment,container,false);
  9. //return super.onCreateView(inflater, container, savedInstanceState);
  10.  
  11. }
  12.  
  13. @Override
  14. public void onAttach(Context context) {
  15. super.onAttach(context);
  16. Log.v("Begin", new Date() + "DeviceListFragment связан с Activity");
  17. }
  18.  
  19.  
  20. @Override
  21. public void onCreate(@Nullable Bundle savedInstanceState) {
  22. super.onCreate(savedInstanceState);
  23. Log.d("Begin", new Date()+"starting DeviceListFragment");
  24. deviceArrayList = DevicesBase.getDevicesBase(getActivity()).getDeviceArrayList();
  25. ArrayAdapter<LaboratoryDevice> adapter = new ArrayAdapter<LaboratoryDevice>(getActivity(),
  26. android.R.layout.simple_list_item_1,
  27. deviceArrayList);
  28. setListAdapter(adapter);
  29.  
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement