Welcome to the 5th edition of the Android Development Tidbits Series!
OSX’s default file system is not case sensitive but the terminal IS. So if you name a file
myClass.java and then rename it to be
MyClass.java you will run into issues. Two of them include Git not tracking the rename and the compiler generating a class that doesn’t match the file name. This can also cause a huge problem if you have peers developing on linux (case sensitive).
- Tidbit Contributor, Charlie
Parse is weird with user queries and
authData, so checking if an account is connected with Facebook will break after you query while including the user. Fix is to call
fetch() after the query on the current user to refetch the auth data https://github.com/ParsePlatform/Parse-SDK-Android/issues/269
- Tidbit Contributor, Eric
When using Picasso, if you use
resize() and put one of the dimensions as 0 it will maintain aspect ratio.
- Tidbit Contributor, Sean
If you roll your own viewpageradapter, it doesn’t come with state saving out of the box. A call to saveState() just returns null. - Tidbit Contributor, Frank
If you want your views to save state, you MUST give them an id. - Tidbit Contributor, Frank
In Android Studio - If you Alt-Enter over a regex, you get an option for a regex checker to make sure it works. - Tidbit Contributor, Frank
If you are using the twitter sdk, make sure you do
Picasso.setSingletonInstance() before you initialize the Twitter Fabric SDK. The
TweetUi class in the
TwitterCore will initialize the Picasso Instance. So, it may crash when you call
- Tidbit Contributor, Evan T.
You can deploy to multiple emulators / attached Android devices in Android Studio by Command+Clicking your desired Connected Devices, or use Command+A to select them all. - Tidbit Contributor, Evan H.