Perform setup(Activity) just once

Change-Id: Icf77936c4307f816e85cb840d650a4c958a15995
This commit is contained in:
Tor Lillqvist
2012-08-13 07:40:27 +03:00
parent 2a787251b2
commit 1060cd8459

View File

@@ -124,10 +124,17 @@ public class Bootstrap extends NativeActivity
public static native void delete_byte_buffer_wrapper(long bbw);
static boolean setup_done = false;
// This setup() method is called 1) in apps that use *this* class as their activity from onCreate(),
// and 2) should be called from other kinds of LO code using apps.
public static void setup(Activity activity)
public static synchronized void setup(Activity activity)
{
if (setup_done)
return;
setup_done = true;
String dataDir = null;
ApplicationInfo ai = activity.getApplicationInfo();