Answers for "navigate from one activity to another android"

10

intent android open activity

Intent intent = new Intent(this, DisplayMessageActivity.class);
        intent.putExtra(key:,value:);
        startActivity(intent);
Posted by: Guest on May-19-2020
2

navigate from one fragment to another android

Intent i=new Intent(MainActivity.this,SecondActivity.class);
startActivity(i);
Posted by: Guest on November-04-2021
2

navigate from one fragment to another android

Fragment fragment = new tasks();
FragmentManager fragmentManager = getActivity().getSupportFragmentManager();
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
fragmentTransaction.replace(R.id.content_frame, fragment);
fragmentTransaction.addToBackStack(null);
fragmentTransaction.commit();
Posted by: Guest on November-04-2021
0

navigate to another activity in android

OnClickListener onClickListener = new OnClickListener() {
    @Override
    public void onClick(View v) {
        startActivity(new Intent(action));
    }
};

Button button = (Button) findViewById(id);
button.setOnClickListener(onClickListener);
Posted by: Guest on July-13-2020

Code answers related to "navigate from one activity to another android"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language