Android Question How To Prevent Activity Screen To Reload After Back Key Pressed

Richard Goh

Active Member
Licensed User
Longtime User
Dear all the experts,

As refer to above, I currently have the problem due to user pressed back key during the program loading data into CustomListView from the website.
My program have a main and sub activities option forms. When user click on sub-activity option, it will download a list of data from website and load into CustomListView.
The activity screen will reload many times (depend on how many record to be loaded) when the user pressed back key while the list is still loading.
I had tried to place below code but the Activity will be re-created again. Is there any way to stop the loading activity thoroughly when the back key is pressed?
Any advices or suggestion is welcome and highly appreciated.

Thanks in advance.

B4X:
Sub activity_KeyPress (KeyCode As Int) As Boolean
    If KeyCode = KeyCodes.KEYCODE_BACK Then
        Activity.Finish
    End If
    Return False
End Sub
 

Richard Goh

Active Member
Licensed User
Longtime User
Hi Erel,
Is B4XPages only available in latest version? I am currently using version 10.0 only and didn't find the library reference for B4XPages.
Thank you.
 
Upvote 0
Top