Intent jump back

Let's talk about how to make a simple jump first. The first thing you need to jump to a page is a class. That's right.
 
 
The Intent class is interpreted as the meaning of intent and there are two ways to jump: one is
Implicit jumps and direct jumps
First, let's talk about the benefits of declarative jumps:
1: If the application only wants to start a component with a certain characteristic and does not want to be coupled with a specific component, it can be processed by configuring the corresponding properties in the intent-filter, which is similar to the MVC framework idea in studts2.

2: Intent is used to encapsulate the "invocation intent" of the program. Between two activities, the data to be exchanged can be encapsulated into Bundle objects, and then the Bundle objects can be carried by Intent. Implement data exchange between two Activities ;

Let's take a look at the code directly here
 
  
Intent kk= new Intent(this,Demo.class);
 startActivity (kk);
NEW comes out of the Intent class, this is the meaning of the context, Demo.class is the class I jump to, StartActivity is the parameter in the start jump, just put your Intent object, so that the direct jump is realized;




Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326045323&siteId=291194637