Time of Update: 2018-12-03
1: APP WIGHT的 AppWidget Provider 設定檔 appwight_provider.xml 建立xml檔案->類型:AppWidget
Time of Update: 2018-12-03
1:自訂TextView/* * Copyright (C) 2007 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * *
Time of Update: 2018-12-03
關於 TextView 或者 EidtView 。。。。 顯示文字如果超長,怎麼讓最後的地方 ... 顯示出來,還要適應不同尺寸的螢幕(最好還能適應橫豎屏切換)當時為了 先趕工,隨便寫了個 方式(自己先鄙視一下我自己)String show = notice.getText();show = show.length() > 18 ? show.substring(0, 18) + "..." : show;這個方式漏洞多的 讓人抓狂,首先 如果中英文混雜 這裡 就沒法判斷
Time of Update: 2018-12-03
記錄個小問題,這兩天用到了android中的遠端偵錯一個開發板,經常碰到一個問題,android中ADB server didn't ACK * failed to start daemon 或者找不到sdk的路徑 或者 adb server is out of date。網上搜了一下,發現大部分說的是在工作管理員中關閉adb.exe的進程,關閉Eclipse ,然後都重新啟動,但是現在最讓人鬱悶的是工作管理員根本就找不到adb.exe。 另外一種現象是在cmd視窗輸入adb
Time of Update: 2018-12-03
1:Content by ID/* * Copyright (C) 2008 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at *
Time of Update: 2018-12-03
/** * 一個執行個體講明為什麼要使用內部類內部類 * 例: * 人休是一個類,人體內部又有一些器官,如心、肝,脾、胃、腎 * 描述心臟的時候,可以把它當成是人體的一個功能,直接用函數來描述嗎?這個可以,但你覺得 * 一個函數足以描述心臟這個事物嗎?心臟裡邊有屬性,有行為,它是一個比較複雜的個體。它裡 * 邊包含著跳動,血壓,等很多屬性行為。屬性行為多了,就要用對象封裝。所以用類描述心臟。 *
Time of Update: 2018-12-03
餓漢模式:加截類的時候就建立對象class Single{ private Single(){} private static Single s = new Single(); pubic static Single getInstance(){ return s; }}懶漢模式:調用getInstance()方法時才建立對象class Single{ private Single(){} private static
Time of Update: 2018-12-03
核心的主要設定檔的詳細說明以下是核心的主要設定檔的詳細說明: 1.Code maturity level options:代碼成熟等級。 1.1.prompt for development and/or incomplete code/drivers. 在Linux的世界裡,每天都有許多人為它發展支援的driver和加強它的核心。但是有些driver還沒進入穩定的階段。但其作者很歡迎其他人去測
Time of Update: 2018-12-03
public Bitmap getBitmap(byte[] bytes) {Options opt = new Options();opt.inJustDecodeBounds = true; //只分配邊界不分配像素DecodeBitmap時候decodeBitmap(bytes, opt);if (opt.outHeight * opt.outWidth < MAX_IMAGE_PIXELS) {return decodeBitmap(bytes, null);}return
Time of Update: 2018-12-03
遇到一個問題, 情況是這樣的:一個Activity,上面只有一個錄音按鈕。一個popupWindow,點擊錄音按鈕,發出命令,彈出popupwindow。popwindow裡面有一個EditText,點擊文字框,就要彈出軟鍵盤,進行手寫輸入。點擊喇叭,就可以切換到語音輸入。從手寫輸入到語音錄入切換的時候不能關閉popupwindow,否則前面輸入的內容就沒了。現在有一個矛盾:
Time of Update: 2018-12-03
一、用法 struct cpu_workqueue_struct { spinlock_t lock; long remove_sequence; /* Least-recently added (next to run) */long insert_sequence; /* Next to add */ struct list_head worklist;wait_queue_head_t more_work;wait_queue_head_t work_done; struct
Time of Update: 2018-12-03
1、比較兩個路徑下檔案的不同diff -Naur -X linux-2.6.19/Documentation/dontdiff linux-2.6.19/ linux-2.6.19-dirty/ > my_patch 2、NFSlinux ubuntu nfs 共用 a.安裝nfs 伺服器端和用戶端 sudo apt-get install portmap nfs -kernel-server sudo apt-get install portmap nfs -common
Time of Update: 2018-12-03
本節介紹一下EditText中進行文字截獲和事件監聽。
Time of Update: 2018-12-03
背景圓角及圖片圓角處理.設定檔實現<?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@drawable/icon_home_button_img"/> <item
Time of Update: 2018-12-03
發現自己還真是發燒友,安裝要花8 9 個小時 ,然後安裝完畢了。看起來還真是酷,感覺舒服的多了。但是按官方的安裝方法那要花個 8 9個小時啊。我想了個辦法,把我已經安裝好的主題拷貝出來,然後大家可以快速下載這樣就快多了。可以下載這個 : zegeblog-themes.zip這裡面有壁紙,有主題,還有登入視窗。設定登入視窗要把themes檔案夾裡的主題拷貝到/usr/share/gdm/themes裡。 看起來超酷的哦。下面是官方的圖紙Showtime for
Time of Update: 2018-12-03
最近看別人的代碼,看到了onNewIntent方法,不知道幹嘛用的,於是研究一下。onNewIntent調用時機 在IntentActivity中重寫下列方法:onCreate onStart onRestart onResume onPause onStop onDestroy onNewIntent一、其他應用發Intent,執行下列方法:I/@@@philn(12410): onCreateI/@@@philn(12410): onStartI/@@@philn(12410):
Time of Update: 2018-12-03
原創 menu.addIntentOptions 添加動態菜單 收藏android的一個activity可以再選中某項之後按menu鍵彈出特定的菜單,也就是動態菜單。動態菜單的實現是靠menu類中的addIntentOptions函數實現的,具體的聲明如下:int android.view.Menu.addIntentOptions( int groupId, int itemId, int order,
Time of Update: 2018-12-03
現在UI設計瀑布流很火啊,貌似國內Android界,蘑菇街上是第一個嘗試的。後來我又發現了一些地方也用到了,比如愛畫報(http://aihuabao.cn),世紀佳緣。其中後面兩個是圖文結合的,我覺得比較好。下面就是我在《愛畫報》官網上截的圖。不多說,先,描述下我想做個什麼樣的效果。下面是網頁上的效果,就是不單純的是圖片的堆積,而是在圖片下面還帶文字說明。下面是,特意截了個美女,哈哈貌似android業界蘑菇街最早用瀑布流效果,但感覺蘑菇街的瀑布流效果介面只有純粹的圖片效果,不好看。於是我想在
Time of Update: 2018-12-03
收集整理各種Flag的作用,只有用到新的再補充,所以這裡的列表不是完整的,隨時更新。先是Flag的用法:1234Intent it=new
Time of Update: 2018-12-03
一、什麼是Intent:在一個Android應用中,Intent是對執行某個操作的一個抽象描述,Intent 負責提供組件之間相互調用的相關資訊傳遞,實現調用者和被調用者之間的解耦。二、Intent的屬性:Intent是對執行某個操作的一個抽象描述,其描述的內容包括,對執行動作Action的描述、對操作資料的描述、還有4種附加屬性的描述。分別介紹如下: Action ,對執行動作的描述,是個字串,是對所將執行的動作的描述,在Intent類中定義了一些字串常量作為標準動作,譬如:view