2

I've done code to display maths formula in TextView with the use of following code.

webView.loadDataWithBaseURL("http://bar/", "<script type='text/x-mathjax-config'>"
                +"MathJax.Hub.Config({ " 
                +"showMathMenu: false, "
                +"jax: ['input/TeX','output/HTML-CSS'], " // output/SVG
                +"extensions: ['tex2jax.js','toMathML.js'], " 
                +"TeX: { extensions: ['AMSmath.js','AMSsymbols.js',"
                +"'noErrors.js','noUndefined.js'] }, "
                +"'SVG' : { blacker: 30, "
                +"styles: { path: { 'shape-rendering': 'crispEdges' } } } "
                +"});</script>"
                +"<script type='text/javascript' "
                +"src='file:///android_asset/MathJax/MathJax.js'"
                +"></script>"
                +"<script type='text/javascript'>getLiteralMML = function() {"
                +"math=MathJax.Hub.getAllJax('math')[0];"
                // below, toMathML() rerurns literal MathML string
                +"mml=math.root.toMathML(''); return mml;"
                +"}; getEscapedMML = function() {"
                +"math=MathJax.Hub.getAllJax('math')[0];"
                // below, toMathMLquote() applies &-escaping to MathML string input
                +"mml=math.root.toMathMLquote(getLiteralMML()); return mml;}"
                +"</script>"
                //+"<style type=\"text/css\">" 
                //+"@font-face { font-family: MyCustomFont;"  
                //+"src:url(\"file:///android_asset/shruti.ttf\");}"
                //+"body {font-family: 'MyCustomFont';}"
                //+"</style>"
                +"<p><span id='math'></span><p><pre><span id='mmlout'></span></pre>"
                +"<script type='text/javascript'>"
                +"document.getElementById(\"math\").innerHTML='\\\\["+doubleEscapeTeX(question.getQuestion())+"\\\\]';"
                +"</script>","text/html","utf-8","");

Now i want to display that type of content like Maths formula or HTML Content in RadioButton

How can create Custom View for RadioButton that displays like WebView with Radio.

Your Help will be Greatly Appreciated.

Pratik Butani
  • 60,504
  • 58
  • 273
  • 437
  • The only way is you need to have four web view behave like Radio button. Means four webview with different colour automatically identify as radio button . No need to display as the options are radio button. Else **`Choice is Yours`**.. – Shabbir Dhangot Aug 20 '14 at 05:17
  • Can you give me example for that how can i handle onClick event and Selection of any one. – Pratik Butani Aug 20 '14 at 05:24
  • I don't have any example It's just an Idea. I have made application with MATAJAX but options are simple answers(Radio buttons). you can refer my app on play store: https://play.google.com/store/apps/details?id=avayaplus.android.competativeexamgeek – Shabbir Dhangot Aug 20 '14 at 05:55

0 Answers0