Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
G

George S Mulbah II

@George S Mulbah II
About
Posts
1
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • how to add a button in one the navigation drawer fragment so that when the user click he is directed to another sub fragment of that previous fragment
    G George S Mulbah II

    how to add button in the of the menu item fragment of the navigation drawer so that when the user click on the button he is redirected to anther sub fragment but one issue here is I am using the android custom navigation drawer implementation below is my try

    package com.example.entertainmentlab.ui.store;

    import android.os.Bundle;
    import android.view.LayoutInflater;
    import android.view.View;
    import android.view.ViewGroup;
    import android.widget.ImageView;
    import android.widget.TextView;
    import android.widget.Toast;
    
    import androidx.annotation.NonNull;
    import androidx.annotation.Nullable;
    import androidx.fragment.app.Fragment;
    import androidx.fragment.app.FragmentManager;
    import androidx.fragment.app.FragmentTransaction;
    import androidx.lifecycle.Observer;
    import androidx.lifecycle.ViewModelProviders;
    
    import com.example.entertainmentlab.R;
    import com.example.entertainmentlab.ui.setting.SettingViewModel;
    
    public class StoreFragment extends Fragment {
    
        private StoreViewModel StoreViewModel;
    
        public View onCreateView(@NonNull LayoutInflater inflater,
                                 ViewGroup container, Bundle savedInstanceState) {
            StoreViewModel =
                    ViewModelProviders.of(this).get(StoreViewModel.class);
            View root = inflater.inflate(R.layout.fragment\_store, container, false);
           final ImageView MusicButton = root.findViewById(R.id.music\_btn);
    
    
    
    
    
    
    
            MusicButton.setOnClickListener(new View.OnClickListener() {
               @Override
               public void onClick(View v) {
                   try {
    
                       Fragment fragment = new BlankFragment();
                       FragmentManager fragmentManager = getActivity().getSupportFragmentManager();
                       FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
                       fragmentTransaction.replace(R.id.nav\_host\_fragment\_container, fragment);
                       fragmentTransaction.addToBackStack(null);
                       fragmentTransaction.commit();
                   }catch (Exception e ){
                       Toast.makeText(getActivity(), "erro  "+e, Toast.LENGTH\_SHORT).show();
                   }
               }
           });
    //        StoreViewModel.getText().observe(getViewLifecycleOwner(), new Observer() {
    /
    
    Android tutorial android com design docker
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups