This is the json response below from ifeng api.
Please help me how to show text object in a TextView including images in the middle.
This is the json response below from ifeng api.
Please help me how to show text object in a TextView including images in the middle.
Use webwiev and load following json response(text witch are in html form) on webview.
Try This First pars that data ,then get text from text param
After getting the HTML text You need to use Html.fromHtml()
If your you are targeting < Android Nougat
yourTextView.setText(Html.fromHtml("PUT YOUR HTML CODE HERE"));
If your you are targeting >= Android Nougat
yourTextView.setText(Html.fromHtml("PUT YOUR HTML CODE HERE", Html.FROM_HTML_MODE_COMPACT));
Note:-
To distinguish between Android versions use Build.VERSION.SDK_INT >= Build.VERSION_CODES.N
Happy Coding!!
Try using TextView.setText(Html.fromHtml(...))
, then using html tags in ...
, but you need to implement Html.ImageGetter
Reference: https://stackoverflow.com/a/7442725/1636610
you can show image in textview as drawable like below -
tvTitle.setText("Hi");
tvTitle.setCompoundDrawablesWithIntrinsicBounds(R.drawable.icon, 0, 0, 0);//it will show icon image on left side of the text on tvTitle text view.