Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私のアプリでは、hdpi-drawablesフォルダーにかなりの数のグラフィックファイルがあります。これらのファイルは、リストアクティビティのアイコンである必要があります。したがって、ArrayAdapterで、値をsetImageDrawableに設定します。
したがって、名前といくつかの別のプロパティを取得するためにリソースにあるすべてのファイルを反復処理する方法が必要です。それを行う方法はありますか?
このメソッドを使用すると、名前で描画可能なIDを見つけることができます
int id = getResources().getIdentifier("name_of_resource", "drawable", getPackageName());