次のコード行では...
ProgressDialog progressDialog = ProgressDialog.show(getBaseContext(), "LOADING_TITLE", "LOADING_MESSAGE");
getBaseContext() の代わりに試しました...
getApplicationContext() // returns "java.lang.NullPointerException"
getBaseContext() // returns "java.lang.NullPointerException"
(NativeActivity)getApplicationContext()
this // returns "The method show(Context, CharSequence, CharSequence) in the Type ProgressDialog is not applicable for the arguments(new Runnable(){}, String, String)"
NativeActivity.this // returns "java.lang.NullPointerException"
NativeActivity.this.getApplicationContext() // returns "java.lang.NullPointerException"
NativeExtension.context.getActivity().getBaseContext() // returns “android.view.WindowManager$BadTokenException: Unable to add window — token null is not for an application”
myActivity.getApplicationContext() // returns “android.view.WindowManager$BadTokenException: Unable to add window — token null is not for an application”
myActivity.getBaseContext() // returns “android.view.WindowManager$BadTokenException: Unable to add window — token null is not for an application”
とりわけ。なぜ機能しないのかわかりません。FREContext を拡張する NativeExtensionContext では、getActivity() を使用してアクティビティを NativeActivity に渡しています。すべて正常に動作しますが、Context への参照を取得しようとすると、「Nullpointerexception」または「android.view.WindowManager$BadTokenException: Unable to add window — token null is not for an application」が表示されます。
Adobe AIR Native Extensions や Android Java の使用経験がある方なら誰でも歓迎します。