Closing Previous Activity makes the app faster?

Asked

Viewed 437 times

3

I was developing an application for Android and I came up with a question:

In my main class MainActivity i have the function setContentView that initializes my screen, but if I want to open other Activity I need to close the previous ones to make the app faster?

It’s a silly question but I want to know if the app gains performance by closing the views previous.

2 answers

3

Making an app more optimized requires several preparations in addition to closing previous activitys. Logically, when closing a previous Activity, it frees up memory and can help with processing. But that alone is not enough. Redo the operating logic of the app, it may be that you have been creating many activitys, and you could group the functions in a few screens... Another thing, it may help, is to decrease the creation of copies of variables while the app is running. Uploading images and resource dependencies over the internet can make your app look slow, where it would actually be downloading data.

I hope I’ve helped!

0

It’s very likely to stay, but if you need to return to the previous Activity you will need to do an Intent.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.