アプリケーションコンテキストを使用してリソースをロードおよびアクセスできるのに、なぜアクティビティコンテキストを使用するのですか? Activity Contextの代わりにApplication Contextを使用すると、例外が発生しないので、なぜActivity Contextを使用するのですか?
例:
以下の例では、アクティビティのonCreate()内で「 this」ポインタの代わりにgetApplicationContext()を使用すると、例外なく正常に動作します。
Button button = new Button(getApplicationContext());