Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to Set Previous Title of a Fragment When Back Pressed in Java?

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 24
    Answer it
    I have created a activity in which I placed a fragment and inside fragment I have used a card view. when I click on card view it moves to next fragment and set title of card view to next fragment toolbar. The problem is when I press back button previous fragment not showing its name and showing next fragment name. Is there any solution for this problem?
    
    
    cardLaw.setOnClickListener(new View.OnClickListener() {
               @Override
               public void onClick(View v) {
                   replaceFragment(new CategoryDetailFragment());
                   ((MainActivity) getActivity()).getSupportActionBar().setTitle("Law & Order");
               }
           });

 0 Answer(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: