我有两个文件夹(每个文件夹包含50个文本文件)

时间:2017-09-26 12:20:36

标签: java android user-interface

我有两个文件夹(每个文件夹包含50个文本文件)。我放了一个按钮,它将调用特定的文本文件,单击该按钮时将调用该文件。抱歉我问的方式不合适。请帮我解决问题

MainActiviy

        @Override
        public void on Click(View view) {
            String text="";

            Buffered Reader b r = null;
            File Reader f r = null;


            try {
                f r = new File Reader("assets\\Job\\Job1.txt");
                b r = new Buffered Reader(f r);
                String line;
                in t count=0;
                while ((line = b r. read Line()) != null) {
                    count++;
                    if(count==19) {
                        System .out. print ln(line);
                    }
                }
            } catch (IO Exception e) {
                e. print Stack Trace();
            } finally {
                try {
                    if (b r ! = null)
                        b r . close();
                    if (f r != null)
                        f r. close();
                } catch (IO Exception ex) {
                    ex. print Stack Trace();
                }
            }

            t v_ new. set Text(text);
        }
    });
}
}

0 个答案:

没有答案