android how to open a new activity in fragment

http‮.www//:s‬lautturi.com
android how to open a new activity in fragment
Button button1 = (Button) rootView.findViewById(R.id.button1);

button1.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View view) {
        Intent intent = new Intent(getActivity(), AnotherActivity.class);
		
        startActivity(intent);
    }
});
Created Time:2017-09-17 15:16:28  Author:lautturi