Issue
I am learning WorkManager
and wondering if following the correct way of setting network constraint for both Wifi and data (cellular):
val constraints = Constraints.Builder().run {
setRequiredNetworkType(NetworkType.UNMETERED) //Wifi
setRequiredNetworkType(NetworkType.METERED) //data
build()
}
Solution
That's exactly the use case for the NetworkType.CONNECTED
type:
Any working network connection is required for this work.
Answered By - ianhanniballake
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.