基于Android CALL && SendMes Test的相關(guān)介紹
Intent:當(dāng)找到與設(shè)置的Intent限制相同的Activity時(shí)候通過startActivity()就會啟動該Activity
電話播號器:
intent.setAction("android.intent.action.CALL");
intent.addCategory("android.intent.category.DEFAULT");
intent.setData(Uri.parse("tel:" + strmobile));
startActivity(intent);//方法內(nèi)部會自動為Intent添加類別:android.intent.category.DEFAULT
短信發(fā)送器:
SmsManager manager = SmsManager.getDefault();
ArrayList<String> texts = manager.divideMessage(comtent);
for (String text : texts) {
manager.sendTextMessage(number, null, text, null, null);// 4和5參數(shù)分別為短信發(fā)送狀態(tài),對方是否收到短信狀態(tài);
}
Toast.makeText(getApplicationContext(),R.string.success,Toast.LENGTH_LONG).show();
吐西對話框// Toast.makeText(MainActivity.this, resId, duration);//內(nèi)部類訪問外部類;
****************************************************************
findViewById(R.id.button);// 根據(jù)id查找顯示控件;
View.OnClickListener() {
@Override
public void onClick(View arg0) {
//arg0 就是被點(diǎn)擊的對象
}
}
@+id/button:在R文件的id內(nèi)部類里面,添加一個(gè)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;
相關(guān)文章
Android?OpenCV基礎(chǔ)API清晰度亮度識別檢測
這篇文章主要為大家介紹了Android?OpenCV基礎(chǔ)API清晰度亮度識別檢測,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪2023-01-01
Android ListView彈性效果的實(shí)現(xiàn)方法
這篇文章主要為大家詳細(xì)介紹了Android ListView彈性效果的實(shí)現(xiàn)方法,感興趣的小伙伴們可以參考一下2016-05-05
Android開發(fā)之在程序中時(shí)時(shí)獲取logcat日志信息的方法(附demo源碼下載)
這篇文章主要介紹了Android開發(fā)之在程序中時(shí)時(shí)獲取logcat日志信息的方法,結(jié)合實(shí)例形式較為詳細(xì)的分析了實(shí)時(shí)獲取logcat日志的原理、步驟與相關(guān)實(shí)現(xiàn)技巧,并附帶相應(yīng)的demo源碼供讀者下載參考,需要的朋友可以參考下2016-02-02
Android SQLite數(shù)據(jù)庫操作代碼類分享
這篇文章主要介紹了Android SQLite數(shù)據(jù)庫操作代碼類分享,本文直接給出實(shí)現(xiàn)代碼和使用代碼,需要的朋友可以參考下2015-03-03
Flutter 全局點(diǎn)擊空白處隱藏鍵盤實(shí)戰(zhàn)
這篇文章主要介紹了Flutter 全局點(diǎn)擊空白處隱藏鍵盤實(shí)戰(zhàn),文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2020-09-09
Android實(shí)現(xiàn)簡潔的APP更新dialog數(shù)字進(jìn)度條
這篇文章主要為大家詳細(xì)介紹了Android實(shí)現(xiàn)簡潔的APP更新dialog數(shù)字進(jìn)度條,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2017-04-04
flutter TextField換行自適應(yīng)的實(shí)現(xiàn)
這篇文章主要介紹了flutter TextField換行自適應(yīng)的實(shí)現(xiàn),文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2020-02-02

