How to acquire the Context in an Adobe AIR Native Extension?
- by rotaercz
In the following line of code...
ProgressDialog progressDialog = ProgressDialog.show(getBaseContext(), "LOADING_TITLE", "LOADING_MESSAGE");
In place of getBaseContext() I've tried...
getApplicationContext()
this
NativeActivity.this
(NativeActivity)getApplicationContext()
Among others. I'm not sure why it's not working. In the NativeExtensionContext which extends FREContext I am passing the activity using getActivity() to NativeActivity. Everything works well but I get a "Nullpointerexception" or “android.view.WindowManager$BadTokenException: Unable to add window — token null is not for an application” when I try I try to get a reference to the Context.
Anyone with experience using Adobe AIR Native Extensions and/or Android Java would be great.