Solution for Spotify gray screen

1. Open Terminal app
2. Type this into terminal. By doing this you can open folder with locales:

cd /Applications/Spotify.app/Contents/Resources/locales/

3. Type this into terminal – this deletes all locales because of what Spotify shows gray screen:

rm -rf arb.mo de.mo el.mo es-419.mo es.mo fi.mo fr-CA.mo fr.mo hu.mo id.mo it.mo ja.mo nl.mo pl.mo pt-BR.mo ru.mo sv.mo tr.mo zh-Hant.mo zsm.mo

Android Material Colors Palette

<?xml version="1.0" encoding="utf-8"?>
<resources>

    <item name="white" type="color">#ffffff</item>
    <item name="black" type="color">#000000</item>
    <item name="brown" type="color">#795548</item>
    <item name="pink" type="color">#e91e63</item>
    <item name="red" type="color">#f44336</item>
    <item name="blue" type="color">#2196f3</item>
    <item name="purple" type="color">#9c27b0</item>
    <item name="deeppurple" type="color">#673ab7</item>
    <item name="lightblue" type="color">#03a9f4</item>
    <item name="cyan" type="color">#00bcd4</item>
    <item name="teal" type="color">#009688</item>
    <item name="green" type="color">#4caf50</item>
    <item name="lightgreen" type="color">#8bc34a</item>
    <item name="lime" type="color">#cddc39</item>
    <item name="yellow" type="color">#ffeb3b</item>
    <item name="amber" type="color">#ffc107</item>
    <item name="orange" type="color">#ff9800</item>
    <item name="deeporange" type="color">#ff5722</item>
    <item name="gray" type="color">#9e9e9e</item>
    <item name="bluegray" type="color">#607d8b</item>
    <item name="indigo" type="color">#3f51b5</item>

</resources>

Android Enhanced WebView example

public class MainActivity extends AppCompatActivity {

    private WebView mWebview;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        mWebview = new WebView(this);

        mWebview.getSettings().setJavaScriptEnabled(true); // enable javascript
        mWebview.getSettings().setRenderPriority(WebSettings.RenderPriority.HIGH);
        mWebview.getSettings().setCacheMode(WebSettings.LOAD_DEFAULT);
        if (Build.VERSION.SDK_INT >= 19) {
            mWebview.setWebContentsDebuggingEnabled(true);
            mWebview.setLayerType(View.LAYER_TYPE_HARDWARE, null);
        } else {
            mWebview.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
        }

        mWebview.setWebViewClient(new WebViewClient());
        mWebview.setWebChromeClient(new WebChromeClient(){
            @Override
            public void onReceivedTitle(WebView view, String title) {
                getWindow().setTitle(title); //Set Activity tile to page title.
            }
        });

        if (savedInstanceState == null) {
            mWebview.loadUrl("http://joerichard.net");
        }

        setContentView(mWebview);

    }

    @Override
    protected void onSaveInstanceState(Bundle outState) {
        super.onSaveInstanceState(outState);
        mWebview.saveState(outState);
    }

    @Override
    protected void onRestoreInstanceState(Bundle savedInstanceState) {
        super.onRestoreInstanceState(savedInstanceState);
        mWebview.restoreState(savedInstanceState);
    }

    @Override
    public void onBackPressed() {
        if (mWebview.canGoBack()) {
            mWebview.goBack();
        } else {
            super.onBackPressed();
        }
    }

}

Android – How to save webview state?

        private WebView mWebview;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        mWebview = new WebView(this);

        if (savedInstanceState == null) {
            mWebview.loadUrl("http://joerichard.net");
        }

        setContentView(mWebview);
    }


    @Override
    protected void onSaveInstanceState(Bundle outState) {
        super.onSaveInstanceState(outState);
        mWebview.saveState(outState);
    }

    @Override
    protected void onRestoreInstanceState(Bundle savedInstanceState) {
        super.onRestoreInstanceState(savedInstanceState);
        mWebview.restoreState(savedInstanceState);
    }