зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1401354 - [4.0] Always load settings from intent extra in geckoview_example. r=snorp
This commit is contained in:
Родитель
703a6f1baa
Коммит
4be4dd80e3
|
@ -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
|
||||||
|
|
Загрузка…
Ссылка в новой задаче