我正在研究可搜索的字典。它使用 SQLite 数据库。字典格式如下(2 列用“-”分隔)
Apple - One kind of fruit
Cricket - One type of game
Titanic - One type of Movie
这Apple是列A,One kind of fruit是列B
我已经更新了我的数据库,如下所示
Apple - res/raw/Apple.txt
Titanic- res/raw/Titanic.txt
我想Apple.txt在用户搜索时打开文件并显示文本Apple。但我使用的示例代码仅适用于 TextView,而不是打开文件、缓冲区和 ViewText。
这是我的代码,它在我的应用程序中显示 B 列
TextView details = (TextView) findViewById(R.id.details);
details.setMovementMethod(new ScrollingMovementMethod());
请建议我如何通过替换上述代码从搜索查询中打开 Apple.txt?
[发布更新]