freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

安卓手機(jī)操作系統(tǒng)的設(shè)計(jì)畢業(yè)論文-資料下載頁(yè)

2025-06-22 18:15本頁(yè)面
  

【正文】 day=(day, 01)。 int hour=(hour, 00)。 int minute=(minute, 00)。 // 將時(shí)間設(shè)置為定時(shí)的時(shí)間 Calendar calendar = ()。// 代表當(dāng)前時(shí)間的日歷 (, year)。 (, month1)。//轉(zhuǎn)換為系統(tǒng)月份,從0計(jì) (, day)。 (, hour)。 (, minute)。 (, 0)。//整分 (, 0)。//設(shè)定字符串,用于在通知中顯示:String str0=getResources().getString()。String str1=getResources().getString()+year +getResources().getString()+month +getResources().getString()+day +getResources().getString()+hour +getResources().getString()+minute+getResources().getString()+ getResources().getString()。 (notifyId, this, , , str0, str0, str1)。//定義一個(gè)服務(wù),用于后臺(tái)發(fā)送短信: Intent intent =new Intent(,)。 PendingIntent sender=(getApplicationContext(), 0, intent, 0)。//定義一個(gè)AlarmManager,并將服務(wù)與AlarmManager進(jìn)行綁定: AlarmManager am=(AlarmManager)getSystemService(ALARM_SERVICE)。 (, (), sender)。//set為執(zhí)行一次后取消,(setRepeating為循環(huán)執(zhí)行)//更新開機(jī)啟動(dòng)列表: UpDateAAPre(Smss_Timer,true)。//用Toast提示定時(shí)短信已開啟,等待發(fā)送: (, ).show()。}此定時(shí)服務(wù)是在用戶點(diǎn)擊“發(fā)送”按鈕并且在定時(shí)功能打開的情況下觸發(fā)的,在button點(diǎn)擊事件的代碼如下:if(!()){ ……}else{ if(isAfter(myear,mmonth,mday,mhour,mminute)){//TODO 啟動(dòng)定時(shí)發(fā)送服務(wù) messagePre()。//存儲(chǔ)信息 setDateTime()。//存儲(chǔ)日期時(shí)間 updateContactPre()。//存儲(chǔ)聯(lián)系人列表 readMessageAndShow()。//顯示信息 startAlarmService()。//啟動(dòng)定時(shí)服務(wù) }else{ (false)。 (false)。 (, , ).show()。 }}在上述代碼中,調(diào)用了很多存儲(chǔ)相應(yīng)信息的方法,下面逐一介紹其意義。messagePre():用于存儲(chǔ)定時(shí)發(fā)送的短信息,用put方法將光標(biāo)前字段和光標(biāo)后字段分別存放到message_before與message_after變量中。代碼為://存儲(chǔ)信息字段public void messagePre(){String string = ().toString()。String cut_sString = (0, ())。String end_sString = ( (), ())。SharedPreferences pres = getSharedPreferences(SmssPre,)。 ed = ()。(message_before, cut_sString)。//取得光標(biāo)前字符串(message_after, end_sString)。//取得光標(biāo)后字符串 ()。 }setDateTime():存儲(chǔ)日期和時(shí)間的方法,用戶設(shè)定起初已經(jīng)設(shè)定好了定時(shí)時(shí)間,并且存儲(chǔ)在公共變量myear,mmonth,mday,mhour,mminute中,此方法就是將這些變量保存到表單,供用戶查閱。代碼如下:public void setDateTime(){ SharedPreferences pres = getSharedPreferences(SmssPre,)。 ed = ()。 (year, myear)。 (month, mmonth)。 (day, mday)。 (hour, mhour)。 (minute, mminute)。 ()。 }updateContactPre():將聯(lián)系人稱謂和電話號(hào)碼對(duì)應(yīng)存儲(chǔ)到表單中,用for循環(huán)依次存儲(chǔ),這樣存儲(chǔ)不用擔(dān)心稱謂和電話號(hào)碼的不一致://存儲(chǔ)所選聯(lián)系人的數(shù)據(jù)public void updateContactPre(){ if(()){//定時(shí)功能打開的時(shí)候才能存儲(chǔ)SharedPreferences pres = getSharedPreferences(SmssPre,)。 ed = ()。 clearContactPre()。 try{ (count,())。//記錄所選聯(lián)系人個(gè)數(shù) if(()){//是否發(fā)送聯(lián)系人稱謂 (isinsert, true)。 //記錄插入服務(wù)的狀態(tài) }else{ (isinsert, false)。 } ()。 int count=(count, 0)。 for(int i = 0。icount。i++){ (name+i, (i))。 (phone+i, (i))。 } ()。 }catch(Exception e){//TODO ()聯(lián)系人數(shù)據(jù)清空后有錯(cuò)誤 } }}readMessageAndShow():將在表單中的短信內(nèi)容數(shù)據(jù)讀取出來,顯示到UI界面上:public void readMessageAndShow(){ String message。 SharedPreferences pres = getSharedPreferences(SmssPre,)。 if((isinsert, false)){ message=(message_before, )+name+(message_after, )。 }else{ message=(message_before, )+(message_after, )。 } (message)。 }startAlarmService():?jiǎn)?dòng)定時(shí)服務(wù),前面已經(jīng)介紹過,在此就不必贅述。當(dāng)發(fā)送定時(shí)短信后,系統(tǒng)界面的任務(wù)欄會(huì)提示一個(gè)消息和圖表,這是用于提醒用戶正在等待定時(shí)短信的發(fā)送。在本系統(tǒng)中,大多的后臺(tái)服務(wù)都會(huì)建立一個(gè)任務(wù)欄圖表,這樣對(duì)用戶更直觀,管理手機(jī)更方便。這樣的狀態(tài)欄通知圖表是調(diào)用SDK中的notificationManager來實(shí)現(xiàn)的,在此自定義了一個(gè)單獨(dú)的公有類,用于在本程序中調(diào)用此類,節(jié)省代碼量:public static void makeNotify(int id,Context from,Class? to,int icon, String tickerText,String title,String body){ notificationManager = (NotificationManager) from .getSystemService(NOTIFICATION_SERVICE)。// 獲取系統(tǒng)服務(wù)(消息管理) // 點(diǎn)擊通知時(shí)轉(zhuǎn)移內(nèi)容 intent = new Intent(from, to)。 // 設(shè)置點(diǎn)擊通知時(shí)顯示內(nèi)容的類 pendIntent = (from, 0, intent, 0)。 notification = new Notification()。 = icon。// 設(shè)置在狀態(tài)欄顯示的圖標(biāo) = tickerText。//設(shè)置在狀態(tài)欄顯示的內(nèi)容 // 設(shè)置通知顯示的參數(shù) (from, title, body, pendIntent)。 (id, notification)。// 執(zhí)行通知. } public static void cancelNotify(int id){ (id)。 } public static void cancelAll(){ ()。 }}:此模塊的界面設(shè)置是套用android專門用于建立設(shè)置界面的PreferenceScreen格式,首先將頁(yè)面布局寫在res/xml文件夾下,布局代碼如下(列出結(jié)構(gòu),部分代碼省略):PreferenceScreen xmlns:android= android:title=@string/manager_title ! 離開模式 PreferenceCategory android:key=@string/manager_leave_allandroid:title=@string/manager_leave_all_title xmlns:android= ! 離開模式check CheckBoxPreference ……/CheckBoxPreference ! 設(shè)置回復(fù)對(duì)象 ListPreference ……/ListPreference ! 設(shè)置回復(fù)內(nèi)容 EditTextPreference ……/EditTextPreference ! 設(shè)置回復(fù)事件 ListPreference ……/ListPreference /PreferenceCategory ! 翻轉(zhuǎn)靜音 PreferenceCategory …… ! 翻轉(zhuǎn)靜音check CheckBoxPreference ……/CheckBoxPreference ! 設(shè)置翻轉(zhuǎn)后動(dòng)作 ListPreference ……/ListPreference /PreferenceCategory/PreferenceScreen布局文件寫完后,在activity中,要繼承PreferenceActivity類:public class Manager extends PreferenceActivity implements OnSharedPreferenceChangeListener {……}在onCreate()方法中,將布局文件與activity關(guān)聯(lián): (savedInstanceState)。 //從xml文件中添加Preference項(xiàng)addPreferencesFromResource()。對(duì)頁(yè)面的改變都會(huì)觸發(fā)一個(gè)onSharedPreferenceChanged方法://當(dāng)數(shù)據(jù)改變時(shí)執(zhí)行 @Overridepublic void onSharedPreferenceChanged(SharedPreferences arg0, String arg1) { updateState()。 }:此方法中調(diào)用了一個(gè)自定義的方法updateState,用于更新數(shù)據(jù)表單中的信息,每次變更時(shí)都要對(duì)數(shù)據(jù)表中的數(shù)據(jù)進(jìn)行讀取,并實(shí)時(shí)顯示在頁(yè)面中://讀取當(dāng)前狀態(tài)method public void updateState(){ //刷新狀態(tài) leave_check_state=(leave_check_key, false)。 leave_list_human_state=(leave_list_human_key, friends)。 leave_list_action_state=(leave_list_action_key, phone)。 overturn_check_state=(overturn_check_key, false)。 overturn_list_action_state=(overturn_list_action_key, mute)。 //刷新界面 (getText(leave_list_human))。 (getText(leave_edit_message))。 (getText(leave_list_action))。 (getText(overturn_list_action))。 //刷新服務(wù)//自動(dòng)回復(fù)服務(wù) if(leave_check_state==false){ Intent intent=new Intent(,)。 stopService(intent)。 UpDateAAPre(Manager_Leave,false)。 }else if(leave_check_state==true){ Intent intent=new Intent(,)。 startService(intent)。 UpDateAAPre(Manager_Leave,true)。 }//翻轉(zhuǎn)靜音服務(wù) if(overturn_check_state==false)
點(diǎn)擊復(fù)制文檔內(nèi)容
環(huán)評(píng)公示相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1