Skip to content
Advertisement

How to open recent avtivity after app reopen in android studio

How to open recent activity after app reopen in android studio For Example, we create a book application Then after reopening the app, open the last page where we are

JavaScript

Advertisement

Answer

Create a Default activity as a launcher activity `public class Default extends AppCompatActivity {

JavaScript

}`

//In MainActivity while saving preferences use: `public class MainActivity extends AppCompatActivity {

JavaScript

}`

//In MainActivity2 while saving preferences use: ` public class MainActivity2 extends AppCompatActivity {

JavaScript

}`

Advertisement