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

正文內(nèi)容

手機安全衛(wèi)士--java課程設(shè)計(編輯修改稿)

2025-07-12 00:23 本頁面
 

【文章內(nèi)容簡介】 /lv_appmanager android:layout_width=fill_parent android:layout_height=fill_parent /ListView /RelativeLayout /LinearLayout : private LinearLayout ll_uninstall。//卸載 private LinearLayout ll_start。//啟動 private LinearLayout ll_share。//分享 private PopupWindow popupWindow。 private String clickedpackname。 //當(dāng)應(yīng)用程序在子線程中全部加載成功后,通知主線程顯示數(shù)據(jù) 10 private Handler handler = new Handler() { public void handleMessage( msg) { switch () { case LOAD_APP_FINSISH: ()。 (new AppManagerAdapter())。 break。 } }。 }。 @Override protected void onCreate(Bundle savedInstanceState) { setContentView()。 (savedInstanceState)。 tv_appmanager_mem_avail = (TextView) findViewById()。 tv_appmanager_sd_avail = (TextView) findViewById()。 ll_loading = (LinearLayout) findViewById()。 lv_appmanager = (ListView) findViewById()。 (SD 卡可用 + getAvailSDSize())。 (內(nèi)存可用 : + getAvailROMSize())。 pm = getPackageManager()。 //加載所有應(yīng)用程序的數(shù)據(jù) fillData()。 //為 ListView 設(shè)置點擊事件 (new OnItemClickListener() { public void onItemClick(AdapterView? parent, View view, int position, long id) { //當(dāng)用戶點擊下一個 Item 時,需要關(guān)閉已經(jīng)存在的 PopupWindow dismissPopupWindow()。 //將布局文件轉(zhuǎn)成 view,該 view 用于顯示 PopupWindow 中的內(nèi)容 View contentView = (getApplicationContext(), , null)。 //分別獲取到 PopupWindow 窗體中的 卸載、啟動、分享 控件所對應(yīng)的父控件 ll_uninstall = (LinearLayout) contentView .findViewById()。 ll_start = (LinearLayout) contentView .findViewById()。 11 ll_share = (LinearLayout) contentView .findViewById()。 //為 卸載、啟動、分享 設(shè)置點擊事件 ()。 ()。 ()。 //獲取用于顯示 PopupWindow 內(nèi)容的 View 的根布局,這里是要為該布局設(shè)置動畫(相當(dāng)于為 PopupWindow 設(shè)置動畫) LinearLayout ll_popup_container = (LinearLayout) contentView .findViewById()。 //設(shè)置一個縮放的動畫效果 ScaleAnimation sa = new ScaleAnimation(, , , )。 //設(shè)置動畫執(zhí)行的時間 (300)。 //獲取到當(dāng)前 Item 的對象 Object obj = (position)。 //當(dāng) Item 為系統(tǒng)應(yīng)用時,此時為 PopupWindow 中的 卸載 設(shè)置一個標(biāo)記,在卸載時判斷該標(biāo)記,禁止卸載系統(tǒng)應(yīng)用 if (obj instanceof AppInfo) { AppInfo appinfo = (AppInfo) obj。 clickedpackname = ()。 if (()) { (true)。 } else { (false)。 } } else { return。 } //獲取到當(dāng)前 Item 離頂部、底部的距離 int top = ()。 int bottom = ()。 //創(chuàng)建 PopupWindow 窗體時必須要指定窗體的大小,否則不會顯示在界面上。參數(shù)一:窗體中用于顯示內(nèi)容的 viewContent,參數(shù)二、三:表示PopupWindow 窗體的寬和高 popupWindow = new PopupWindow(contentView, (getApplicationContext(), 200), bottom top + (getApplicationContext(), 20))。 // 注意 :一定要給 popwindow 設(shè)置背景圖片或背景資源 ,如果不設(shè)置背景資源 , 動畫、 焦點的處理 都會產(chǎn)生問題。 (new ColorDrawable( ))。 //獲取到 Item 在窗體中顯示的位置 int[] location = new int[2]。 12 (location)。 //參數(shù)一: PopupWindow 掛載在那個 View 上,參數(shù)二:設(shè)置PopupWindow 顯示的重心位置 //參數(shù)三: PopupWindow 在 View 上 X 軸的偏 移量,參數(shù)四:PopupWindow 在 View 上 Y 軸的偏移量。 X、 Y 軸的偏移量是相對于當(dāng)前 Activity所在的窗體,參照點為( 0, 0) (view, | , location[0] + 20, location[1])。 // 播放一個縮放的動畫 . (sa)。 } })。 /** * 當(dāng)用戶滑動窗體的時候 ,需要關(guān)閉已經(jīng)存在的 PopupWindow */ (new OnScrollListener() { // 當(dāng) listview 的滾動狀態(tài)發(fā)生改變的時候 調(diào)用的方法 . public void onScrollStateChanged(AbsListView view, int scrollState) { } // 當(dāng) listview 處于滾動狀態(tài)的時候 調(diào)用的方法 public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) { dismissPopupWindow()。 } })。 } /** * 將手機中的應(yīng)用程序全部獲取出來 */ private void fillData() { //加載數(shù)據(jù)時, ll_loading 控件中的 ProgressBar 以及 TextView 對應(yīng)的“正在 加載數(shù)據(jù) ...”顯示出來 ()。 new Thread() { public void run() { AppInfoProvider provider = new AppInfoProvider( )。 appinfos = ()。 initAppInfo()。 13 //向主線程發(fā)送消息 Message msg = ()。 = LOAD_APP_FINSISH。 (msg)。 }。 }.start()。 } /** * 初始化系統(tǒng)和用戶 appinfos 的集合 */ protected void initAppInfo() { systemappInfos = new ArrayListAppInfo()。 userappInfos = new ArrayListAppInfo()。 for (AppInfo appinfo : appinfos) { //區(qū)分出用戶程序和系統(tǒng)程序 if (()) { (appinfo)。 } else { (appinfo)。 } } } /** * 當(dāng) Activity 銷毀時,需要關(guān)閉 PopupWindow,因為 PopupWindow 掛載有TextView, * 如果不關(guān)閉該窗體的話,并不影響程序的執(zhí)行,但 Log 中會出現(xiàn)AppManagerActivity has leaked window的紅色錯誤提示。 */ @Override protected void onDestroy() { dismissPopupWindow()。 ()。 } //適配器對象 private class AppManagerAdapter extends BaseAdapter { //獲取 ListView 中 Item 的數(shù)據(jù) public int getCount() { // 因為 listview 要多顯示兩個條目(用戶程序和系統(tǒng)程序) return () + 1 + () + 1。 } //獲取到 Item 所對應(yīng)的對象 14 public Object getItem(int position) { //當(dāng) position == 0 則對應(yīng)的是“用戶程序”條目 if (position == 0) { return position。 } else if (position = ()) {// 當(dāng) position = ()則對應(yīng)的是手機中所有用戶程序條目 // 要顯示的用戶程序的條目在集合中的位置(因為用戶程序?qū)?yīng)的 Item 是從 1 開始的,而集合中的角標(biāo)是從 0 開始的) int newpostion = position 1。 return (newpostion)。 } else if (position == (() + 1)) {//當(dāng) position == (() + 1)則對應(yīng)的是“系統(tǒng)程序”條目 return position。 } else {//所有系統(tǒng)應(yīng)用條目 int newpostion = position () 2。 return (newpostion)。 } } //獲取 Item 所對應(yīng)的 id public long getItemId(int position) { return position。 } //將 View 顯示在 Item 上,每顯示一個 Item,調(diào)用一次該方法 public View getView(int position, View convertView, ViewGroup parent) { if (position == 0) {//當(dāng) position == 0 則對應(yīng)的是“用戶程序”條目,我們創(chuàng)建出該條目對應(yīng) 的 View TextView tv = new TextView(getApplicationContext())。 (20)。 (用戶程序 ( + () + ))。 return tv。 } else if (position = ()) {
點擊復(fù)制文檔內(nèi)容
畢業(yè)設(shè)計相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號-1