11
13

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

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フォルダを作成しないとダメ

11
13
0

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
11
13

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?