LoginSignup
13

More than 3 years have passed since last update.

AndroidStudioでassetsフォルダを使うとき

Last updated at Posted at 2015-12-09

AndroidStudioでassetsフォルダが参照できずにハマった時のメモ

こんな感じで読み込み処理をする

        AssetManager as = getResources().getAssets();
        InputStream is = null;
        try {
            is = as.open("test.csv");
        } catch (IOException e) {
            e.printStackTrace();
        }

assetsフォルダを作ってcsvを置く

エラーが出る

java.io.FileNotFoundException: test.csv

AndroidStudioではsrc > mainの中にassetsフォルダを作成しないとダメ

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
13