android webview mailto,android – Webview电子邮件链接(mailto)
我有一个视图,并查看网站有malito代码发送电子邮件.当我打开链接打开一个错误.我想要的是,当我打开链接打开Gmail应用程序或其他电子邮件应用程序.感谢所有的帮手.public class teacher extends Activity implements OnClickListener {WebView webView;final Activity activity = this;@Ov
我有一个视图,并查看网站有malito代码发送电子邮件.
当我打开链接打开一个错误.
我想要的是,当我打开链接打开Gmail应用程序或其他电子邮件应用程序.
感谢所有的帮手.
public class teacher extends Activity implements OnClickListener {
WebView webView;
final Activity activity = this;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.getWindow().requestFeature(Window.FEATURE_PROGRESS);
setContentView(R.layout.teacher);
webView = (WebView) findViewById(R.id.webView145);
webView.getSettings().setJavaScriptEnabled(true); webView.loadUrl("https://dl.dropboxusercontent.com/u/233211/%D7%A8%D7%A9%D7%99%D7%95%D7%9F/iWebKit%20demo/ther.html");
webView.setWebChromeClient(new WebChromeClient() {
public void onProgressChanged(WebView view, int progress) {
activity.setTitle("Loading...");
activity.setProgress(progress * 100);
if (progress == 100)
activity.setTitle(R.string.app_name);
} });
webView.setWebViewClient(new WebViewClient() {
@Override
public void onReceivedError(WebView view, int errorCode,
String description, String failingUrl) {
// Handle the error
}
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true; } });}
public void onBackPressed() {
if (webView.canGoBack()) {
webView.goBack();
} else {
Intent B = new Intent(this, MainActivity.class);
startActivity(B);
}}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (event.getAction() == KeyEvent.ACTION_DOWN) {
switch (keyCode) {
case KeyEvent.KEYCODE_BACK:
if (webView.canGoBack() == true) {
webView.goBack();
} else {
finish();
}return true;} }
return super.onKeyDown(keyCode, event);
}
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
}}
更多推荐
所有评论(0)