Bug 1401354 - [4.0] Always load settings from intent extra in geckoview_example. r=snorp

This commit is contained in:
Eugen Sawin 2017-09-20 18:16:52 +02:00
Родитель 703a6f1baa
Коммит 4be4dd80e3
1 изменённых файлов: 7 добавлений и 3 удалений

Просмотреть файл

@ -71,6 +71,7 @@ public class GeckoViewActivity extends Activity {
permission.androidPermissionRequestCode = REQUEST_PERMISSIONS; permission.androidPermissionRequestCode = REQUEST_PERMISSIONS;
mGeckoView.setPermissionDelegate(permission); mGeckoView.setPermissionDelegate(permission);
loadSettings(getIntent());
loadFromIntent(getIntent()); loadFromIntent(getIntent());
} }
@ -79,18 +80,21 @@ public class GeckoViewActivity extends Activity {
super.onNewIntent(intent); super.onNewIntent(intent);
setIntent(intent); setIntent(intent);
loadSettings(intent);
if (intent.getData() != null) { if (intent.getData() != null) {
loadFromIntent(intent); loadFromIntent(intent);
} }
} }
private void loadFromIntent(final Intent intent) { private void loadFromIntent(final Intent intent) {
final Uri uri = intent.getData();
mGeckoView.loadUri(uri != null ? uri.toString() : DEFAULT_URL);
}
private void loadSettings(final Intent intent) {
mGeckoView.getSettings().setBoolean( mGeckoView.getSettings().setBoolean(
GeckoViewSettings.USE_MULTIPROCESS, GeckoViewSettings.USE_MULTIPROCESS,
intent.getBooleanExtra(USE_MULTIPROCESS_EXTRA, true)); intent.getBooleanExtra(USE_MULTIPROCESS_EXTRA, true));
final Uri uri = intent.getData();
mGeckoView.loadUri(uri != null ? uri.toString() : DEFAULT_URL);
} }
@Override @Override