How to make Latex show in RemoteView?
- Markwon version: 4.6.2
- Please specify expected/actual behavior
I need to display the Latex formula in an Android AppWidget. I use Markwon inside the App, but I can't assign a value because I can't get the TextView object in the AppWidget. Is there any way to solve this?
- Please specify conditions/steps to reproduce (layout, code, markdown used, etc)
Spanned xxx = markwon.toMarkdown("$$\n"+"xxx"+"\n$$");
RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.appwidget_xxx);
views.setTextViewText(R.id.tv_xxx, xxx);
ask for help
@noties ask for help
Hello @zhouzhuo810 ,
unfortunately it won't be possible to display Markwon in a widget. Widgets use IPC (interprocess communication), so to display a spanned content - only platform spans can be used (that come from Android directly). Markwon uses own spans, so they won't be displayed - not only LaTeX, but others too.
You can take a look at the RemoteViewsSample, which substitutes custom spans with platform ones. But still LaTeX won't be possible, as internally it uses Drawable, which cannot be sent between processes