如何在Android中的sqlite中存储的文本中添加图像 [英] How to add images within texts that stored in sqlite in android

查看:78
本文介绍了如何在Android中的sqlite中存储的文本中添加图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在文本之间添加一些图像.我将文本存储在sqlite db中.如何确定文本中图像的正确位置.例如,在一堂课中有5个段落,我将所有这些段落存储在名为body_of_lesson的db中一行的一个单元格中.现在,我想在第一段的第三行之后添加一个图像,在第二段之后添加一个图像.如何确定这些位置并将图像添加到这些位置?在其他课程中,位置可能会有所不同.我将文本以HTML格式保存到数据库中.

I want to add some images between the texts. I stored texts in sqlite db. How can I determine the right location of images in texts. For example, I have 5 paragraphs in one lesson that I stored all those paragraphs in one cell of a row in db named body_of_lesson. Now I want to add an image after line 3 of first paragraph and 1 image after second paragraph. How can I determine these locations and add images into the locations? In other lessons might be vary the locations. I saved texts as HTML formatted into the database.

请帮助我!

推荐答案

在html中使用图片引用.例如<a href="file:///**",其中**是存储在sqlite中的图像路径.

use image ref in your html. e.g. <a href="file:///**", which ** is the image path stored in sqlite.

这篇关于如何在Android中的sqlite中存储的文本中添加图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆