Home - Orange168/NotesOnReading GitHub Wiki

[TOC]

Google Android SDK doc notes

######Design ######Develop

Notes on Reading

if(viewToMeasure.getViewTreeObserver().isAlive()) {
        viewToMeasure.getViewTreeObserver().addOnGlobalLayoutListener(new OnGlobalLayoutListener() {
            @Override
            public void onGlobalLayout() {
                if(viewToMeasure.getViewTreeObserver().isAlive()) {
                    // only need to calculate once, so remove listener
                    viewToMeasure.getViewTreeObserver().removeGlobalOnLayoutListener(this);
                }

                // you can get the view's height and width here

                // the listener might not have been 'alive', and so might not have been removed....so you are only
                // 99% sure the code you put here will only run once.  So, you might also want to put some kind
                // of "only run the first time called" guard in here too                                        

            }
        });            
    }

Editor.md directory

editor.md/
        lib/
        css/
        scss/
        tests/
        fonts/
        images/
        plugins/
        examples/
        languages/     
        editormd.js
        ...
```html
Custom Logging 
see in the LogCat:
Crashlytics.log(int priority, String tag, String msg) <==> Crashlytics.log(Log.ERROR, "MyApp", "Higgs-Boson detected! Bailing out..."); 
Don't write to LogCat
Crashlytics.log(msg) ;
Custom Keys
Crashlytics.setInt("current_level", 3);
Crashlytics.setString("last_UI_action", "logged_in");

User Information
void setUserIdentifier(String identifier); 
void setUserName(String name); 
void setUserEmail(String email); 
Logging Caught Exceptions

try {
  myMethodThatThrows();
} catch (Exception e) {
  Crashlytics.logException(e);
  // handle your exception here! 
}
<script src="../dist/js/languages/en.js"></script> <script src="../dist/js/languages/zh-tw.js"></script>
[reference]: http://developer.android.com/reference/packages.html "developer.android.com"
⚠️ **GitHub.com Fallback** ⚠️