• Latest Code...

    How to implement CSS file in Android App

    Here is the simplest way to implement your CSS file in android application.

    WebViews in your native Android app, to display HTML which is packaged with the app, then you can use CSS like in any HTML site.

    WebVie webView=(WebView) findViewById(R.id.webViewDetials);

    StringBuilder sb = new StringBuilder();
    sb.append("<HTML><HEAD><LINK href=\"http://google.com/css/attribute.css\" type=\"text/css\" rel=\"stylesheet\"/></HEAD><body>");
    webView.loadDataWithBaseURL(null, sb.toString(), "text/html", "utf-8", null);

    Happy Coding!!!

    No comments:

    Post a Comment


    Most recent Elastic Search tutorials for beginner, intermediate and advance level developer, Yubraj Pokharel, in CodingWorkspace