AFAICT the asset manager is tied to the application and not the activity,
so this simple approach should be safe even if the activity gets destroyed
and recreated due to orientation change or whatever.
namespace Android {
MainThread::MainThread(ANativeActivity *a):
+ asset_manager(a->assetManager),
starting_up(true)
{
attach_to_activity(a);
private:
ANativeActivity *activity;
+ AAssetManager *asset_manager;
bool starting_up;
Mutex startup_mutex;
void wait_for_app_created();
void resume_startup();
+ AAssetManager *get_asset_manager() const { return asset_manager; }
+
private:
virtual void main();