Answers for "fragment get intent android"

1

get intent not working in fragment

// add the getActivity() before getIntent and it should work perfectly 
// inside your fragment
Bundle bundle = getActivity().getIntent().getExtras();
Posted by: Guest on August-25-2020
6

intent in fragment android

Button button = (Button) rootView.findViewById(R.id.button1);
button.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View view) {
        Intent intent = new Intent(getActivity(), AnotherActivity.class);
        startActivity(intent);
    }
});
Posted by: Guest on June-15-2020

Code answers related to "fragment get intent android"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language