package gurux.dlms.android.ui.media;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentTransaction;
import androidx.lifecycle.ViewModelProvider;
import gurux.dlms.android.R;
import gurux.dlms.android.databinding.FragmentMediaBinding;
public class MediaFragment extends Fragment {
private FragmentMediaBinding binding;
public View onCreateView(@NonNull LayoutInflater inflater,
ViewGroup container, Bundle savedInstanceState) {
MediaViewModel mediaViewModel =
new ViewModelProvider(requireActivity()).get(MediaViewModel.class);
binding = FragmentMediaBinding.inflate(inflater, container, false);
View view = binding.getRoot();
Fragment childFragment = mediaViewModel.getDevice().getMedia().properties();
FragmentTransaction transaction = getChildFragmentManager().beginTransaction();
transaction.replace(R.id.media_fragment_container, childFragment).commit();
return view;
}
@Override
public void onDestroyView() {
super.onDestroyView();
binding = null;
}
}
Hi, You need to get theā¦
Hi,
You need to get the media and then you can change the settings.
Something like this for serial port:
GXSerial serial = (GXSerial) mediaViewModel.getDevice().getMedia();
serial.getBaudRate();
BR,
Mikko
Thank you ....
Thank you ....