Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class ScrabbleApp extends Application {
- public static ArrayList<String> dictionary;
- @Override
- public void onCreate() {
- super.onCreate();
- initDictionary();
- }
- private void initDictionary(){
- dictionary = new ArrayList<>();
- BufferedReader bufferedReader = null;
- try {
- bufferedReader = new BufferedReader(new InputStreamReader
- (getResources().openRawResource(R.raw.russian), StandardCharsets.UTF_8));
- String line;
- while ((line = bufferedReader.readLine()) != null) {
- dictionary.add(line);
- }
- } catch (IOException e) {
- e.printStackTrace();
- } finally {
- if (bufferedReader != null) {
- try {
- bufferedReader.close();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement