![]() ![]() Implementation 'agment:fragment-ktx:1.1.0-rc04' // or remove -ktx if not using kotlin Implementation 'androidx.activity:activity-ktx:1.0.0-rc01' // or remove -ktx if not using kotlin To start using these, add the following lines to the dependency block of your module-level adle file: implementation 'androidx.appcompat:appcompat:1.1.0-rc01' // this is needed to use the updated AppCompatActivity Show me the code!ĭuring development of AndroidX Fragment 1.1.0 and AndroidX Activity 1.0.0, the kind folks at Google added a new way to inflate layouts. I’m glad to say that with a few recent AndroidX library updates, there is a simpler way. At the same time, they feel a bit like boilerplate, right? Wouldn’t it be nice if there was a simpler way to inflate our views? They’re so common to write that it’s easy to not think about them much. ![]() And since the introduction of Fragments, we’ve had to override onCreateView and use a layout inflater to get our view from a layout ID. Activity and Fragment Layouts with AndroidXįor as long as Android development has been around, we’ve been using setContentView to inflate layouts in our Activity classes.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |