Setting a toolbar title on the activity should be easy, right? But what about if you want do it through a fragment? Still easy? Well, not exactly.
The issue is that you may try to touch the toolbar in a moment where the activity is actually still not inflated. This will cause an exception immediately and your app will crash. What is the exact issue?
From time to time I get this really nasty bug where the toolbar in Android Studio is aligned to the start of the screen.
I mean the part where you select the device and press Run, for some reason sometimes just moves to the left and bringing it back to the right is a bit of a pain. Also if you hide the main navigation toolbar by accident, then it is really hard to bring it back. Here is the solution:
Close Android Studio.
Go to Home/.config/Google/AndroidStudio2020.3/options
After that just start Android Studio as normal and all of the toolbars will be placed as they were by default.
Generating a signed build using Android Studio Arctic Fox version 2021.3.1 seem to be a tricky thing to do. I spent several hours just to figure out where the issue is and at the end, I still don’t know what is the exact reason for signing to not work.
Sometimes even simple and easy stuff can be complex on Android. Such is the case where you want to have a bottom sheet dialog with rounded corners which expands to fullscreen. Here is how I did it on Android 6.
Recently I played around with the integration of Google Cast inside Exoplayer and I was really amazed to see how bad it is and how much it sucks. I decided to write this post with the idea it will help someone else who is also struggling with the Google Cast integration for exoplayer.
So the requirements I had for the integration of Google Cast are quite simple:
Play an item on cast
Play a list of items – when you press Next you go to the next item
Forward / Backwards with 30 seconds – so you can skip through the track
Play / Pause support
Switch between lists of items – you can player item 2 of List A, you should be able to switch to item 3 of List B
Switch between phone playback and cast playback – switch from cast to app and from app to cast
Update the progress when casting – time elapsed should also be updated
Gson is outdated a bit with the last commit done quite some time ago. We also had implemented the Moshi library in our Gradle dependencies and these are the 2 reasons why we decided to move away from GSON.
Recently I played around with a library that is used in multiple projects. This library has a huge list of dependencies like: coroutines, rxjava, navigation library from Google, material library, custom edit texts that come from 3rd party libraries and many more. Basically this library has also a rich set of screens available to the users that open given certain conditions. But our issues was bigger.
I am currently working on an app where the devs before me took this strange decision in regard to the refresh token mechanism – have a single entry point of the app which is called every time whenever you need to have a fresh token. What I mean is this: