I have a Tabbed activity with 3 tabs and each tab has its own fragment. there's a button inside the first tab which i want to click and navigate to another Tabbed activity (or any activity which has a fragment). How do I accomplish this ? I am trying to click on a button and open a new activity but i am unable to do so. I would really appreciate if i get some headers as I'm learning android. Here's a link to my fragment class for reference.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_tutorials,container, false);
Button button1 = (Button) view.findViewById(R.id.introbtn1);
button1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent tutorial = new Intent(getActivity(), TutorialIntroduction.class);
startActivity(tutorial);
//Tried to create a toast to check if the button works but it doesn't
//Toast.makeText(getActivity(), "button is clicked!", Toast.LENGTH_LONG).show();
}
});
return view;
}