Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to navigate from one screen to another screen

How to navigate from one Activity screen to another Activity screen? In the first screen I'm having one button if I click the button it has to move to another Activity screen.

like image 488
Kumar Avatar asked Jul 09 '09 05:07

Kumar


People also ask

What is navigation container?

The NavigationContainer is responsible for managing your app state and linking your top-level navigator to the app environment. The container takes care of platform specific integration and provides various useful functionality: Deep link integration with the linking prop.

How do you navigate to another page on button click in React Native?

To redirect to another page on button click in React: Use the useNavigate() hook, e.g. const navigate = useNavigate(); . Call the navigate() function, passing it the path - navigate('/about') . The navigate() function lets us navigate programmatically.


2 Answers

The most trivial case (called from activity):

startActivity(new Intent(this, ActivityToLaunch.class)); 

More details here: http://developer.android.com/guide/topics/fundamentals.html

like image 106
yanchenko Avatar answered Oct 08 '22 07:10

yanchenko


OnClickListener onClickListener = new OnClickListener() {     @Override     public void onClick(View v) {         startActivity(new Intent(action));     } };  Button button = (Button) findViewById(id); button.setOnClickListener(onClickListener); 
like image 39
Chiwai Chan Avatar answered Oct 08 '22 08:10

Chiwai Chan