Skip to main content
The 2024 Developer Survey results are live! See the results

Questions tagged [android-jetpack]

Android Jetpack is a Google's set of libraries, tools and architectural guidance to build Android apps and provides common infrastructure code.

android-jetpack
314 votes
10 answers
207k views

What is AndroidX?

I am reading about a room library of Android. I see they changed package android to androidx. I did not understand that. Can someone explain, please? implementation "androidx.room:room-runtime:$...
Khemraj Open To Work's user avatar
35 votes
2 answers
55k views

Android Jetpack Compose width / height / size modifier vs requiredWidth / requiredHeight / requiredSize

Android Jetpack Compose contains width(), height() and size() layout modifiers as well as requiredWidth(), requiredHeight() and requiredSize(). What is the difference between these two sets of ...
Valeriy Katkov's user avatar
41 votes
5 answers
24k views

Jetpack Compose - Order of Modifiers

Documentation says that Modifiers are applied from the left. But from this example it looks like they are applied from the right: First border and then padding because there is no space between text ...
ivoronline's user avatar
  • 1,019
118 votes
15 answers
173k views

Can I use library that used android support with Androidx projects.

I know, androidx and support dependency causing multidex error We can not use androidx and android support at a same time. So I totally migrate to androidx. but one of my dependency lib used android ...
Hitesh Dhamshaniya's user avatar
88 votes
3 answers
64k views

Android. Is WorkManager running when app is closed?

I want to schedule nightly database updates. So I use new Android WorkManager. My understanding is that once scheduled it will always run in the background independently from the app's lifecycle. Is ...
Tuesday Four AM's user avatar
46 votes
12 answers
36k views

Jetpack Compose collapsing toolbar

I can't find any documents on the matter, is there something similar to a CollapsingToolbar in Compose? All I found was a mention of it here, but nothing on how to set it up
Merig's user avatar
  • 1,971
170 votes
38 answers
143k views

Android Navigation Architecture Component - Get current visible fragment

Before trying the Navigation component I used to manually do fragment transactions and used the fragment tag in order to fetch the current fragment. val fragment:MyFragment = supportFragmentManager....
Alin's user avatar
  • 14.5k
155 votes
32 answers
230k views

Handling back button in Android Navigation Component

I'd like to know how properly handle system back button action using Navigation Controller. In my app I have two fragments (for ex. fragment1 and fragment2) and I have an action in fragment1 with ...
Kiryl Tkach's user avatar
  • 3,455
125 votes
9 answers
49k views

Fragments destroyed / recreated with Jetpack's Android Navigation components

I'm trying to implement Navigation with Jetpack's architecture components in my existing app. I have a single activity app where the main fragment (ListFragment) is a list of items. Currently, when ...
pauminku's user avatar
  • 3,596
8 votes
3 answers
14k views

Different types of width in jetpack compose

I am working in textfield in jetpack compose. I want to build something like this TextField( value = value, onValueChange = { value = it }, ...
Vivek Modi's user avatar
  • 6,129
101 votes
3 answers
52k views

When should I use Android Jetpack Compose's Surface composable?

There's a Surface composable in Jetpack Compose which represents a material surface. A surface allows you to set up things like background color or border but it seems that the same might be done ...
Valeriy Katkov's user avatar
65 votes
5 answers
103k views

Error: "@Composable invocations can only happen from the context of a @Composable function"

I'm trying to show a toast message when clicking on a toolbar action, but I got this error @composable invocations can only happen from the context of a @composable function Code: @Composable fun ...
SNM's user avatar
  • 6,355
33 votes
5 answers
41k views

Android Jetpack Compose mutableStateListOf not doing Recomposition

So, I have a mutableStateListOf in viewModel: var childTravellersList = mutableStateListOf<TravellersDetails>() TravellersDetails is a data class having a field called error. this ...
imn's user avatar
  • 840
21 votes
5 answers
20k views

How to schedule notifications using WorkManager?

I want to schedule a notification everytime the user add a note in the database for a specific time. While there are multiple ways to do it using AlarmManager, BroadcastReceiver etc. How can it be ...
Ankur Gupta's user avatar
65 votes
1 answer
42k views

Android Work Manager vs Services?

In my Android app i have multiple intent services which run one after another and the very first intent service is trigerred by a broadcast. I came across Work Manager a few days ago and really liked ...
Dishonered's user avatar
  • 8,749

15 30 50 per page
1
2 3 4 5
29