2
I am working on a project that is being done virtually all based on fragments
. So far, I’ve only got one activity
and 4 fragments
, within which I need only one of them not to have the ActionBar
. Common methods of hiding from Actionbar have not worked (getActivity().getSupportActionBar().hide();
). How can I do that?
This is the Fragment that I do not wish to have Actionbar:
package com.renanlazarotto.fserv.fragments;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import com.renanlazarotto.fserv.activities.FservActivity;
import com.renanlazarotto.fserv.R;
public class LoginFragment extends Fragment {
public LoginFragment() {
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
((FservActivity) getActivity()).getSupportActionBar().setTitle(R.string.titulo_login);
View view = inflater.inflate(R.layout.fragment_login, container, false);
Button logar = (Button) view.findViewById(R.id.login_button_entrar);
logar.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.container, new ChamadosFragment()).commit();
}
});
return view;
}
}