How to start an activity in background and show it afterwards?

后端 未结 3 1070
青春惊慌失措
青春惊慌失措 2020-12-18 01:38

I\'ve two activities, one is the SplashActivity and the other is MainActivity, an activity containing a webview.

I need to load the webvi

3条回答
  •  半阙折子戏
    2020-12-18 01:56

    Android Apps can cache web data. you can use this to your advantage. (and it worked for me). What I did:

    • I created a WebView in the splash screen.
    • didn't attach it to the UI,
    • requested the webpage I needed in the Main Activity.
    • once the WebView in your splash screen is loaded start the other Activity.

    the WebView there will use the cache of the WebView you created in the splash screen.

提交回复
热议问题