パフォーマンスとメモリの変数をインスタンス化する最も効率的な方法は何ですか?
これ :
Context context = this;
Resources resources = context.getResources();
Drawable drawable = resources.getDrawable(R.drawable.image);
ListView list = (ListView) context.findViewById(R.id.list);
list.setBackgroundDrawable(drawable);
またはこれ:
((ListView) findViewById(R.id.list)).setBackgroundDrawable(getResources().getDrawable(R.drawable.image));
またはそれは問題ではありません、それは同じことなので、私は私が最も好きなものに固執する必要がありますか?