parent
181cfda2a3
commit
a383de367c
|
|
@ -50,6 +50,8 @@ public class ShowVehiclesAndDevicesFragment extends AbstractFragment {
|
|||
//TODO private DeviceAdapter deviceAdapter;
|
||||
private static final int LAUNCH_ACTIVITY_REGISTER_DEVICE = 1;
|
||||
private static final int LAUNCH_ACTIVITY_REGISTER_VEHICLE = 2;
|
||||
|
||||
|
||||
private String TAG = ShowVehiclesAndDevicesFragment.class.getSimpleName();
|
||||
|
||||
@Override
|
||||
|
|
@ -64,14 +66,10 @@ public class ShowVehiclesAndDevicesFragment extends AbstractFragment {
|
|||
});
|
||||
|
||||
launcherEditDevice = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), result -> {
|
||||
Log.d(TAG, "GETTING RESULT");
|
||||
Log.d(TAG, "GETTING RESULT: " + result.getResultCode());
|
||||
Log.d(TAG, "GETTING RESULT: " + result.getResultCode());
|
||||
|
||||
if (result.getResultCode() == Activity.RESULT_OK) {
|
||||
model.reloadDevices();
|
||||
//TODO Device device = ...
|
||||
// deviceAdapter.update(device);
|
||||
// deviceAdapter.notifyDataSetChanged();
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -334,16 +332,12 @@ public class ShowVehiclesAndDevicesFragment extends AbstractFragment {
|
|||
Intent intent = null;
|
||||
if (item != null) {
|
||||
intent = ActivityBaseDetailContent.getDeviceDetailInstance(getActivity(), item.getSerialNumber());
|
||||
// intent = RegisterVehicleActivity.editCurrentItem(getActivity(), vehicle.getVin());
|
||||
|
||||
} else {
|
||||
intent = ActivityBaseDetailContent.getDeviceRegistrationInstance(getActivity(),Activity.RESULT_OK);
|
||||
|
||||
}
|
||||
|
||||
//TODO intent.putExtra(VIN, vehicle.getVin());
|
||||
//TODO intent.putExtra(POSITION, position);
|
||||
|
||||
launcherEditVehicle.launch(intent);
|
||||
}
|
||||
|
||||
|
|
@ -360,9 +354,6 @@ public class ShowVehiclesAndDevicesFragment extends AbstractFragment {
|
|||
// intent = CustomerDe.show(getActivity());
|
||||
}
|
||||
|
||||
//TODO intent.putExtra(VIN, vehicle.getVin());
|
||||
//TODO intent.putExtra(POSITION, position);
|
||||
|
||||
launcherEditDevice.launch(intent);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue