Javascript 不使用特殊字符的意图

Javascript 不使用特殊字符的意图,javascript,android,android-intent,Javascript,Android,Android Intent,我创建了一个浏览器应用程序,它通过一个意图调用接收URL,但是在某些意图中,我使用了#符号,并且没有正确处理它 是否需要编辑我的意图或我的应用程序,以及如何编辑 我的应用程序代码: Intent intent = getIntent(); String url = intent.getStringExtra("id"); if( url == null) { mWebView.loadUrl("http://google.com"); else { mWebView.loadU

我创建了一个浏览器应用程序,它通过一个意图调用接收URL,但是在某些意图中,我使用了
#
符号,并且没有正确处理它

是否需要编辑我的意图或我的应用程序,以及如何编辑

我的应用程序代码:

Intent intent = getIntent();
String url = intent.getStringExtra("id");

if( url == null) {
    mWebView.loadUrl("http://google.com");
else {
    mWebView.loadUrl(url);
}
我的意图:

intent://#Intent;action=android.intent.action.SEND;component=myprogramstuff;S.id="https://blahblahblah/#/blah/blah?stuff=123123123";end

如果您只需要加载url,但无法传递“#”字符,那么您可以将字符解码为html可读的方式。请将“#”替换为“%23”,然后重试。

intent.getStringExtra(“id”)?@MuratK的内容是什么。意图中的S.id。在这种情况下:?它在浏览器中正常工作吗?@MuratK。没有#符号的URL工作正常。所以,如果它只是https://blahblahblah/it,那么加载时不会出现问题。这似乎是可行的。非常感谢。我会提高投票率,但声誉太低。正确答案是什么?你应该能做到