我正在寻找能够词典。它使用SQLite数据库。字典格式是如下图所示(2列的 “ - ” 隔开)如何将[搜索]结果作为文件位置返回?
Apple - One kind of fruit
Cricket - One type of game
Titanic - One type of Movie
这里Apple
是列A
和One kind of fruit
是我已经更新了我的数据库如下面
Apple - res/raw/Apple.txt
Titanic- res/raw/Titanic.txt
B
列
我想在用户搜索Apple
时打开Apple.txt
文件并显示文本。但我使用的示例代码仅用于TextView,而不是打开文件,缓冲区和ViewText。
这里是我的代码显示在我的应用程序
TextView details = (TextView) findViewById(R.id.details);
details.setMovementMethod(new ScrollingMovementMethod());
请建议我如何可以打开Apple.txt从搜索查询替换上述代码B栏?
[更新的Post]
为什么不直接在B列中存储文件路径? – Egor 2013-04-21 07:36:17
为什么在数据库中已有文本时使用文件? – Ridcully 2013-04-21 07:37:40
@Egor非常感谢您的回复。你可以解释我怎么能把文件路径,可以打开应用程序来查看txt?你的答案似乎对我有帮助! – Tanzil 2013-04-21 07:39:02