Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
IBMS
/
nativeview
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
6b2485ff
authored
Mar 01, 2022
by
huangzhicong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复启动时可能因为协程线程池未初始化导致崩溃的问题
parent
77210a24
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 additions
and
3 deletions
+1
-3
app/src/main/java/com/maxrocky/nativeview/fragment/StartFragment.kt
+1
-3
No files found.
app/src/main/java/com/maxrocky/nativeview/fragment/StartFragment.kt
View file @
6b2485ff
...
...
@@ -13,10 +13,8 @@ import androidx.lifecycle.lifecycleScope
import
androidx.navigation.fragment.findNavController
import
com.maxrocky.nativeview.R
import
com.maxrocky.nativeview.utils.dataStore
import
kotlinx.coroutines.Dispatchers
import
kotlinx.coroutines.flow.collect
import
kotlinx.coroutines.flow.map
import
kotlinx.coroutines.launch
import
kotlinx.coroutines.runBlocking
class
StartFragment
:
Fragment
()
{
...
...
@@ -38,7 +36,7 @@ class StartFragment : Fragment() {
urlEditText
=
view
.
findViewById
(
R
.
id
.
url
)
button
=
view
.
findViewById
(
R
.
id
.
enter
)
lifecycleScope
.
launch
(
Dispatchers
.
IO
)
{
lifecycleScope
.
launch
WhenResumed
{
val
storageKey
=
stringPreferencesKey
(
STORAGE_URL
)
context
?.
dataStore
?.
data
?.
map
{
it
[
storageKey
]
?:
""
}
?.
collect
{
urlEditText
.
setText
(
it
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment