源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

基于Android CALL && SendMes Test的相关介绍

  • 时间:2020-08-17 12:29 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:基于Android CALL && SendMes Test的相关介绍
[b]Intent[/b]:当找到与设置的Intent限制相同的Activity时候通过startActivity()就会启动该Activity 电话播号器: intent.setAction("android.intent.action.CALL"); intent.addCategory("android.intent.category.DEFAULT"); intent.setData(Uri.parse("tel:" + strmobile)); startActivity(intent);//方法内部会自动为Intent添加类别:android.intent.category.DEFAULT 短信发送器: SmsManager manager = SmsManager.getDefault(); ArrayList<String> texts = manager.divideMessage(comtent); for (String text : texts) { manager.sendTextMessage(number, null, text, null, null);// 4和5参数分别为短信发送状态,对方是否收到短信状态; } Toast.makeText(getApplicationContext(),R.string.success,Toast.LENGTH_LONG).show(); 吐西对话框// Toast.makeText(MainActivity.this, resId, duration);//内部类访问外部类; **************************************************************** findViewById(R.id.button);// 根据id查找显示控件; View.OnClickListener() { @Override public void onClick(View arg0) { //arg0 就是被点击的对象 } } @+id/button:在R文件的id内部类里面,添加一个id为button的常量,使用该常量的值作为此控件的id值; @android:表示访问android包下的R文件; @id/label:表示访问id为label的文件;(相对布局) 单元测试: 继承类:AndroidTestCase <instrumentation android:name="android.test.InstrumentationTestRunner" android:targetPackage="com.hellokity" /> <application android:icon="@drawable/ic_launcher" android:label="@string/app_name" > <uses-library android:name="android.test.runner" /> </application> actual = function(); Assert.assertEquals(3,actual);判断actual是否为3;
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部