mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
Auto merge of #22013 - ferjm:android.openurl.intent, r=paulrouget
Handle open URL intent on Android - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #21997 This makes it easier to use Servo as the default browser. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/22013) <!-- Reviewable:end -->
This commit is contained in:
commit
657173abd8
1 changed files with 7 additions and 2 deletions
|
@ -7,6 +7,7 @@ package org.mozilla.servo;
|
|||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.system.ErrnoException;
|
||||
|
@ -70,10 +71,14 @@ public class MainActivity extends Activity implements Servo.Client {
|
|||
}
|
||||
}
|
||||
|
||||
String args = getIntent().getStringExtra("servoargs");
|
||||
String log = getIntent().getStringExtra("servolog");
|
||||
Intent intent = getIntent();
|
||||
String args = intent.getStringExtra("servoargs");
|
||||
String log = intent.getStringExtra("servolog");
|
||||
mServoView.setServoArgs(args, log);
|
||||
|
||||
if (Intent.ACTION_VIEW.equals(intent.getAction())) {
|
||||
mServoView.loadUri(intent.getData());
|
||||
}
|
||||
setupUrlField();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue