I'm trying to make an ImageView within a fragment that when I clicked send you another Activity. The problem is that when clicking nothing happens, but I do not get any error to know what is happening.
This is the code of the Fragment.java
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_profile, container, false);
return view;
}
private ProfileFragment mContext = ProfileFragment.this;
private void setupToolbar(){
Toolbar toolbar = (Toolbar) getView().findViewById(R.id.profileToolBar);
((AppCompatActivity)getActivity()).setSupportActionBar(toolbar);
ImageView profileMenu = (ImageView) getView().findViewById(R.id.profileMenu);
profileMenu.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Log.d(TAG, "onClick: navigating to account settings.");
Intent intent = new Intent(getActivity(), AccountSettingsActivity.class);
startActivity(intent);
}
});
}