I'm working on a project that's being done pretty much all based on fragments
. So far, I have only activity
and 4 fragments
, within which I need only one of them does not have ActionBar
. Common methods of hiding ActionBar did not work (% with%). How can I do this?
This is the fragment I do not want 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;
}
}