|
4 | 4 | import java.io.IOException;
|
5 | 5 | import java.io.InputStreamReader;
|
6 | 6 |
|
| 7 | +import android.content.Intent; |
7 | 8 | import com.nucleus.CoreApp;
|
8 | 9 | import com.nucleus.J2SEWindow.Configuration;
|
9 | 10 | import com.nucleus.J2SEWindow.VideoMode;
|
@@ -109,13 +110,34 @@ public abstract class NucleusActivity extends Activity
|
109 | 110 | public void onCreate(Bundle savedInstanceState) {
|
110 | 111 | SimpleLogger.setLogger(new AndroidLogger());
|
111 | 112 | SimpleLogger.d(getClass(), "onCreate()");
|
| 113 | + fetchIntentExtra(); |
112 | 114 | BaseImageFactory.setFactory(new AndroidImageFactory());
|
113 | 115 | activity = this;
|
114 | 116 | checkProperties();
|
115 | 117 | setup(getRenderVersion(), GLSurfaceView.RENDERMODE_CONTINUOUSLY);
|
116 | 118 | super.onCreate(savedInstanceState);
|
117 | 119 | }
|
118 | 120 |
|
| 121 | + private void fetchIntentExtra() { |
| 122 | + Intent intent = getIntent(); |
| 123 | + if (intent != null) { |
| 124 | + Bundle bundle = intent.getExtras(); |
| 125 | + if (bundle != null) { |
| 126 | + fetchProperties(bundle); |
| 127 | + } |
| 128 | + } |
| 129 | + } |
| 130 | + |
| 131 | + private void fetchProperties(Bundle bundle) { |
| 132 | + for (Environment.Property p : Environment.Property.values()) { |
| 133 | + String value = bundle.getString(p.key); |
| 134 | + if (value != null) { |
| 135 | + SimpleLogger.d(getClass(), "Setting property " + p + " to " + value); |
| 136 | + System.setProperty(p.key, value); |
| 137 | + } |
| 138 | + } |
| 139 | + } |
| 140 | + |
119 | 141 | @Override
|
120 | 142 | public void onResume() {
|
121 | 143 | SimpleLogger.d(getClass(), "onResume()");
|
@@ -324,7 +346,7 @@ public void run() {
|
324 | 346 | * MUST be called from the UI thread!
|
325 | 347 | *
|
326 | 348 | * @param title
|
327 |
| - * @param messag |
| 349 | + * @param message |
328 | 350 | */
|
329 | 351 | protected void showAlert(final String title, final String message) {
|
330 | 352 | AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this);
|
|
0 commit comments