private class MyWebClient extends WebViewClient { public boolean shouldOverrideUrlLoading(WebView view, String overrideUrl) { if(overrideUrl.startsWith("http://")){ return false; } else { boolean override = false; Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(overrideUrl)); intent.addCategory(Intent.CATEGORY_BROWSABLE); intent.putExtra(Browser.EXTRA_APPLICATION_ID, getPackageName()); if (overrideUrl.startsWith("sms:")) { Intent i = new Intent(Intent.ACTION_SENDTO, Uri.parse(overrideUrl)); startActivity(i); return true; } if (overrideUrl.startsWith("tel:")) { Intent i = new Intent(Intent.ACTION_CALL, Uri.parse(overrideUrl)); startActivity(i); return true; } if (overrideUrl.startsWith("mailto:")) { Intent i = new Intent(Intent.ACTION_SENDTO, Uri.parse(overrideUrl)); startActivity(i); return true; } try{ startActivity(intent); override = true; } catch(ActivityNotFoundException ex) {} return override; } } };출처 : 안드로이드 펌 [라르크v님]
2013년 4월 11일 목요일
[Android] Call, SMS, Mail 보내기
전화 , sms, 메일 발신 기능
전화걸기
sms 보내기 문자보내기
메일보내기
피드 구독하기:
댓글 (Atom)
댓글 없음:
댓글 쓰기