开发者

android/java replace string to bold or some color in webview in html

开发者 https://www.devze.com 2023-02-18 21:19 出处:网络
i have a string ticker.. ticker=\"hdfc:123:-1.90 tcc:231:+1.3 as continue to hundreds of ticker will get from the server. i just want to bold the name... so help me to find my solution.....

i have a string ticker.. ticker="hdfc:123:-1.90 tcc:231:+1.3 as continue to hundreds of

ticker will get from the server. i just want to bold the name... so help me to find my solution.....

here is my code...

tiker = TickerConnection.getInstance().Ticker();

    WebView mWebView = (WebView) findViewById(R.id.webview);
    mWebView.getSettings().setJavaScriptEnabled(true);String summary = "<html><body><MARQUEE>"+tiker+"</MARQUEE></body></html>";
mWebV开发者_如何学编程iew.loadData(summary, "text/html", "utf-8");


hey following is ur solution... u jst have to add tag <b>

tiker = TickerConnection.getInstance().Ticker();

    WebView mWebView = (WebView) findViewById(R.id.webview);
    mWebView.getSettings().setJavaScriptEnabled(true);String summary = "<html><body><MARQUEE><b>"+tiker+"</b></MARQUEE></body></html>";
mWebView.loadData(summary, "text/html", "utf-8");
0

精彩评论

暂无评论...
验证码 换一张
取 消