Edoardo Luppi
02/25/2024, 3:35 PMfun example(): (String, String) {
return "one", "two"
}
That could be converted by the compiler to a Pair<String, String>
, for example.Youssef Shoaib [MOD]
02/25/2024, 9:08 PMinline
behaviour in Scala? Does something like this just work?
inline def forEach(inline block: Int => Unit): Unit
With block
getting mentioned only once insidejanvladimirmostert
02/27/2024, 8:05 AMT::class.hashCode
where T is an interface (or abstract class) that I control?
interface Foo {
}
inline fun <reified T : Foo> decode(byteArray: ByteArray) {
println(T::class.hashCode())
println(T::class.java.hashCode())
}
class INT4 : Foo {
companion object : Foo
}
itnoles
02/28/2024, 4:30 PMMd Sohail
03/01/2024, 3:13 AMprivate val uniqueWorkName = CountDownWorker::class._java_._simpleName_
@RequiresApi(Build.VERSION_CODES._O_)
fun enqueue(context: Context, force: Boolean = false) {
val manager = WorkManager.getInstance(context)
val requestBuilder = _PeriodicWorkRequestBuilder_<CountDownWorker>(30, TimeUnit._MINUTES_).build()
var workPolicy = ExistingPeriodicWorkPolicy._KEEP_
// Replace any enqueued work and expedite the request
if (force) {
workPolicy = ExistingPeriodicWorkPolicy._UPDATE_
}
manager.enqueueUniquePeriodicWork(
uniqueWorkName,
workPolicy,
requestBuilder
)
}
this is my code snippet, I want to schedule a work which updated the home widget after every 30 minutes. this works fine if the app is running in the foreground but if the app is closed for a long time, the widgets don't update, meaning the work manager doesn't work and it updates the widgets as soon as i open the app.
So, can you guys please help me out? what should I do in this case?Md Sohail
03/01/2024, 3:14 AMelect
03/01/2024, 10:43 AMEdoardo Luppi
03/01/2024, 10:10 PMJack Endorsing
03/02/2024, 8:50 AMMd Sohail
03/04/2024, 4:01 PMMd Sohail
03/05/2024, 11:20 AMStefan Oltmann
03/07/2024, 2:13 PMColton Idle
03/08/2024, 12:51 AMMd Sohail
03/08/2024, 4:21 AMeygraber
03/11/2024, 3:25 AMKClass
property in a field or access it every time (something like foo::class.simpleName
)?Rabia Anjum
03/12/2024, 3:03 PMadambrangenberg
03/15/2024, 9:20 PMitnoles
03/16/2024, 7:42 PMFergus Hewson
03/17/2024, 11:35 PMeygraber
03/19/2024, 6:47 PMJason Zhao
03/20/2024, 12:24 AM..
and ..<
exists, why not`<..` and <..<
?
Currently if I write a >= b && a <= c
the IDE will tell me to replace it with a in b..c
if I write a >= b && a < c
then IDE will not recommend me with anything, but I can still write a in b..<c
and this would be correct, though I'm not sure whether it's optimized by the compiler like the first case.
however, if I write a > b && a < c
there is no way to represent it in ranges if I wanted to! I find this bit of inconsistency to be a little annoying.
Ideally all four operators should be present and optimized by the compiler.elect
03/21/2024, 8:23 AMRay Rahke
03/21/2024, 1:35 PMKlitos Kyriacou
03/21/2024, 6:05 PMsize
property, just like Arrays and Collections, but they have a length()
method instead?Edoardo Luppi
03/24/2024, 10:06 AMCancellationException
when I only use
try {
...
} catch (e: Exception) {
...
}
Tgo1014
03/26/2024, 10:01 AMagrosner
03/26/2024, 12:59 PMAlejandro Rios
03/26/2024, 1:26 PMAlejandro Rios
03/28/2024, 12:27 AM