清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>
打电话发短信的功能.
要授权的,需要在AndroidManifest.xml中加入两行配置
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | //发短信 class SendMsgClickListener implements OnClickListener { public void onClick(View v) { //调用Android系统API发送短信 Uri uri = Uri.parse( "smsto:15800001234" ); Intent intent = new Intent(Intent.ACTION_SENDTO, uri); intent.putExtra( "sms_body" , "android..." ); startActivity(intent); } } //打电话 class SendCallClickListener implements OnClickListener {iphone5 public void onClick(View v) { //调用Android系统API打电话 Uri uri = Uri.parse( "tel:15800001234" ); Intent intent = new Intent(Intent.ACTION_CALL, uri); startActivity(intent); } } |
要授权的,需要在AndroidManifest.xml中加入两行配置
1 2 | < uses-permission android:name = "android.permission.CALL_PHONE" /> < uses-permission android:name = "android.permission.SEND_SMS" /> |