【发布时间】:2016-04-21 05:34:02
【问题描述】:
String fbid = getIntent().getStringExtra("id");//Getting this value from previous screen
Log.e( "What I am getting : " + fbid);
final String url = "https://www.fbbexample.com/abc/"+fbid; //**not working**
Log.e( "url I am getting : " + url); Log value: https://www.fbbexample.com/abc/59
// final String url2 = "https://www.fbbexample.com/abc/"+59; //**this is working**
// Log.e( "url2 I am getting : " + url2); Log value: https://www.fbbexampl.com/abc/59
webView = (WebView) findViewById(R.id.webView);
webView.getSettings().setJavaScriptEnabled(true);
webView.loadUrl(url);
webView.getSettings().setBuiltInZoomControls(true);
webView.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
// webView.getSettings().setBuiltInZoomControls(true);
return true;
}
});
}
}
我面临的是,当我对字符串“fbid”进行硬编码时,它可以工作,当我按照上面提到的方式尝试它时,然后出现空白屏幕.. ....
Intent 意图 = new Intent(getContext(), SingleFbb.class);
intent.putExtra("id",idno);
【问题讨论】:
-
我猜是空格问题
final String url = "https://www.fbb.com/abc/"+fbid; -
This site can’t be reached www.fbb.com refused to connect -
空白无关紧要,它只是示例而不是站点
-
如何将数据传递给此类。发布您的意向电话
-
我在我的 Logcat 中看到了正确的值更新了代码@Ameer