Home > Mobile >  [for] switch Activity
[for] switch Activity

Time:12-29

There are two Activity, A and B
I'm A used button to switch to B
Middle button to the Gridview join data in country B,
Point Home button to return to the desktop, and then some app icon to return to the app, then open is A, point button after entering B, B of the Gridview is empty
I want to achieve is that point back to the app icon after remained in B, and the Gridview data is still there, after B interface returns A point button again to B, the Gridview data is still in!
I ask, how to achieve this? Thank you very much!

CodePudding user response:

Are you A startup mode of the activity is what? Under normal circumstances, you return to the desktop in the B, cut back or B, or either out of memory, either you written in the life cycle method has A problem, error flash back, or A startup mode is singleTask will occur this case
Want to B after the destruction of data still exists, it must to data persistence, to create the restore

CodePudding user response:

In B onresume you achieve your Gridview data loading method

CodePudding user response:

reference 1/f, set up green _ response:
you A startup mode of the activity is what? Under normal circumstances, you return to the desktop in the B, cut back or B, or either out of memory, either you written in the life cycle method has A problem, error flash back, or A startup mode is singleTask will occur this case
Want to B after the destruction of data still exists, it must to data persistence, to create the restore

Boot mode is the default, memory is not, after click Home to return to the desktop, press block key points from the activities list, there is no problem, stay in B, and the data is still in!

CodePudding user response:

refer to the second floor usecf response:
you realize you load the Gridview data in the B's onresume method

I do not want to reload data, and to keep the original state is still there, without having to take it again to read network data

CodePudding user response:

reference toorup reply: 3/f
Quote: refer to 1st floor stand green _ response:
you A startup mode of the activity is what? Under normal circumstances, you return to the desktop in the B, cut back or B, or either out of memory, either you written in the life cycle method has A problem, error flash back, or A startup mode is singleTask will occur this case
Want to B after the destruction of data still exists, it must to data persistence, to create the restore

Boot mode is the default, memory is not, after click Home to return to the desktop, press block key points from the activities list, there is no problem, stay in B, and the data is still in!


I'll start ActivityB mode to singleInstance, click on the desktop pictures after the HOME, or back to ActivityA, but click A button to B, then the original data is still in,
But somehow the screen when switching data, there is no

CodePudding user response:

After B interface returns A point button again to B, is still in the Gridview data, using the database

CodePudding user response:

refer to 6th floor Write_BUG small expert replies:
, after B interface returns A point button again to B, is still in the Gridview data, using database

In the startup mode to B singleInstance, can solve!
Problem now is that under the interface point B Home button back on the desktop, desktop icon into the app again, results are returned to A screen, I'd like some ICONS or back to B interface!

CodePudding user response:

refer to 7th floor toorup response:
Quote: refer to the sixth floor Write_BUG small expert replies:
, after B interface returns A point button again to B, is still in the Gridview data, using database

In the startup mode to B singleInstance, can solve!
Problem now is that under the interface point B Home button back on the desktop, desktop icon into the app again, results are returned to A screen, I'd like some ICONS or back to B interface!
no, in point B Home button back on the desktop, as long as the app runs in the background, system and operation of memory, the app can not be killed, click again on the logo to open the app will be the last open interface

CodePudding user response:

refer to the eighth floor Write_BUG small expert replies:
Quote: refer to 7th floor toorup response:
Quote: refer to the sixth floor Write_BUG small expert replies:
, after B interface returns A point button again to B, is still in the Gridview data, using database

In the startup mode to B singleInstance, can solve!
Problem now is that under the interface point B Home button back on the desktop, desktop icon into the app again, results are returned to A screen, I'd like some ICONS or back to B interface!
no, in point B Home button back on the desktop, as long as the app runs in the background, system and operation of memory, the app can not be killed, click again on the logo to open the app will also is the last open interface

Can I directly back to the start page is now, is to return to the A
  • Related