AAR pt 10 (Android)

     

Android developers banner

If you have not had a chance to read the first entry in the series for context, you can do so here

It’s been a little over a year since I did my last Android AAR entry, so I figured it was about time that I had a new entry on my lessons learned with Android and Kotlin.

  1. “cd ~”
  2. “vim .bash_profile”
  3. paste “export PATH=$PATH:/Users/jtaylor/Library/Android/sdk/platforms”
  1. “adb kill-server”
  2. “adb start-server”

ViewModels must never call View methods directly. This is because Views are typically fragments and activities and are created and destroyed at will, leading to possible null pointer exceptions if called directly.

myView.measure(0,0); myView.getMeasuredWidth() / myView.getDisplayMetrics.density

comments powered by Disqus