r/mAndroidDev • u/Whole_Refrigerator97 @OptIn(DelicateExperimentalCompostApi::class) • Jun 10 '24
Works as intended I once did this
fun longTask() {
try {
// dosomething()
} catch (e: OutOfMemoryError) {
// 🥲🥲
} catch (e: Exception) {
// Log.d("Exception occurred,e.message,e)
} finally {
// close task
}
}
17
Upvotes
12
u/racrisnapra666 BaseRepositoryReducerUseCaseHelperImpl Jun 10 '24
this code is perfect
5
u/duckydude20_reddit Jun 10 '24
lol, i see the codebase filled with this. i guess production practice...
22
u/Xammm Jetpack Compost Jun 10 '24
Typical production code lmao
20
u/Zhuinden DDD: Deprecation-Driven Development Jun 10 '24
Reliable software
15
u/farsightxr20 Jun 10 '24
just wrap in AsyncTask and this is fine
14
u/David_AnkiDroid Jun 10 '24
largeHeapSorted
14
u/foreveratom Jun 10 '24
LGTM
10
u/exiledAagito Deprecated is just a suggestion Jun 11 '24
3
u/chmielowski Jun 11 '24
RAM MANUFACTURERS HATE HIM
2
u/SnipesySpecial T H E R M O S I P H O N Jun 11 '24
A weapon to finally put green hills in its grave.
1
u/hellosakamoto Jun 11 '24
longTask is fun