Time of Update: 2018-12-05
需求:有時候在事先不能取得要多少控制項,就在代碼中動態添加在Layout插入一個View:<LinearLayout android:id="@+id/newsinfo_imgs" android:layout_width="fill_parent" android:layout_height="wrap_content"
Time of Update: 2018-12-05
一、style1、style是針對表單元素層級的,改變指定控制項或者Layout的樣式2、style有繼承,覆蓋3、style定義,在res/styles.xml中定義Android系統的themes.xml和style.xml(位於系統原始碼frameworks\base\core\res\res\values\)包含了很多系統定義好的style,建議在裡面挑個合適的,然後再繼承修改。<?xml version="1.0" encoding="UTF-8"?>
Time of Update: 2018-12-05
1、要實現添加按鈕的操作,必須自訂Adapter,使用Button View的setTag()方法,將Button所屬的位置設定到tag當中2、要實現動態添加刪除ItemView的操作,必須首先調整調整Adapter所繫結資料源,然後調用Adapter的notifyDataSetChanged()方法 3、在adapter中,View的事件不能顯示得對View本身操作,例如:listView.addBnt.setOnClickListener(new OnClickListener() {
Time of Update: 2018-12-05
思路:http://www.eoeandroid.com/thread-81618-1-1.html如果圖片在Drawable下面,可以把圖片的ID給存到資料庫, 想儲存路徑,可以把圖片放在assets檔案夾下面。 絕對路徑:http://blog.csdn.net/svrsimon/article/details/7079320第一種方法:String path = file:///android_asset/檔案名稱;第二種方法:InputStream abpath = getClass()
Time of Update: 2018-12-05
http://leiwuluan.iteye.com/blog/1513167http://zhchzh1000.iteye.com/blog/763406一個上傳圖片的功能,需要對SD中的圖片上傳:file_row.xml<?xml version="1.0" encoding="utf-8"?><TextView android:id="@+id/text1"
Time of Update: 2018-12-05
http://blog.csdn.net/ameyume/article/details/6089334以上連結:實現圖片的放大縮小http://blog.csdn.net/kesenhoo/article/details/6534757以上連結:用另一種思路實現~~~(改天認真讀一下)http://doinone.iteye.com/blog/10742831.直接擷取:(容易:ANR,不建議)mImageView =
Time of Update: 2018-12-05
搜尋了下,有n多方法:http://www.eoeandroid.com/thread-30252-1-1.html一、【親示可行】在eclipse中選擇:window-show view-other-Android-Devices 等到這個Device表徵圖出現的時候就可以看到logcat的資訊了。。。 二、開啟ddms,隨便點擊一個真機下面的進程就會有logcat資訊了... 三、開啟cmd 進入tools目錄下(如果配置了環境的話 就無所謂路徑了) 輸入:adb
Time of Update: 2018-12-05
1、Java Build Path→Libraries中加入msc.jar,注意,需要使用:Add External Jars… ,也就是說msc.jar 不用copy到工作目錄下,否則會出現本題錯誤,不知為何,BUG? 2、Java Build Path→Order and Export,勾選:msc.jar 和其他依賴項目 3、這時編譯運行也許還會出錯(BUG有木有?),重啟下eclipse,或者清理下工程(project→Clear),再重啟下工程,編譯……
Time of Update: 2018-12-05
文章目錄 基本概念foreground task和background taskActivity的多重執行個體管理task和back stack http://coolxing.iteye.com/blog/1279606基本概念task是一系列activity的集合, 這些activity通常因為同一目的而啟動, 系統將這些activity按照建立的順序組織在棧中(也就是所謂的back stack).
Time of Update: 2018-12-05
判斷檔案是否存在:public static boolean isFileExit(String path){ if(path == null){ return false; } try{ File f = new File(path); if(!f.exists()){ return false; } }catch
Time of Update: 2018-12-05
碰到個問題:ListView的onItemClickListener監聽事件,若item裡面有button也監聽事件,則不能同時監聽事件,會有個沒反應。解決方案:解決方案的本質就是不用onItemClickListener的事件,轉移到item裡面某個View的事件方案1、擷取item最外層的view這時候如果你給listView設定listView.setOnItemLongClickListener();事件後,發現只有長按editText才能觸發item的事件,所有擷取焦點失去焦點轉移焦點
Time of Update: 2018-12-05
在android上做了個RSS彙總器,雖然是個很簡單的東西,但我還是必須說還是有點設計的。 1、最簡單實現寫幾個用到的Activity,在這幾個介面間跳轉,完成所有功能。缺點:1、單線程,UI會被網路訪問阻塞
Time of Update: 2018-12-05
協助大家瞭解 Android 平台開發 ,建立AndRoid開發環境 下載開發資源 1、下載最新的Android SDKhttp://code.google.com/android/download.html 選擇Windows 版本的SDK,下載後直接解壓縮就可以使用,為了在控制台中直接使用SDK中的工具,把SDK 的目錄添加到Windows 的path 環境變數中。 2 、下載
Time of Update: 2018-12-05
<?xml version="1.0" encoding="utf-8"?> //指示這個文字檔是以XML格式描述的 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"//XML描述檔案的名稱空間是後面的URL網址 android:layout_width="fill_parent" //填滿整個上層空間
Time of Update: 2018-12-05
android.view.WindowManager$BadTokenException: Unable to add window -- token android.app.LocalActivityManager$LocalActivityRecord@45f48c40 is not valid; is your activity running?今天在寫android 的google 地圖時遇到一個問題,我在地圖上添加一個Overlay 然後想在點擊這個overlay
Time of Update: 2018-12-05
今天運行 android 模擬器的時候,提示adb 無法開啟,並報出如下資訊:[2011-10-24 22:19:57 - GpsTracker] The connection to adb is down, and a severe error has occured.[2011-10-24 22:19:57 - GpsTracker] You must restart adb and Eclipse.[2011-10-24 22:19:57 - GpsTracker] Please
Time of Update: 2018-12-05
android.content.res.Resources$NotFoundException 今天編程時遇到了這種異常 產生異常的代碼如下:distanceChoiceView.setText(PreferenceStoreData.getIntByKey(AroundActivity.this, FinalConst.arroudDistance, 500));產生原因在於 TextView.setText(value) ,其中value必須是String 類型的。而我上面賦值的時Int
Time of Update: 2018-12-05
我在配置好開發環境後(包括java 環境變數)-----1.找到你的debug.keystore檔案 在Eclipse工具下,選擇windows-->Preference-->Android-->Build,其中Default debug keystore的值便是debug.keystore的路徑了。 -----2.取得debug.keystore的MD5值首先cmd命令列進入debug.keystore檔案所在的路徑,執行命令:keytool -list -alias
Time of Update: 2018-12-05
什麼是9.png:可能做過UI美化的同學都會知道,framework-res.apk\res\drawable-hdpi 目錄下有非常非常多的XXXXXX.9.png圖片。千萬不要以為這個9隻是png格式圖片的命名區分,其實他是一種特殊的格式,在png圖片的基礎上動了些手腳,而且這種手腳你會 看不見摸不著(詳情見下面具體內容)。 9.png格式的圖片是安卓平台上新創的一種被展開卻不失真的玩意(挺進階的吧),也許有
Time of Update: 2018-12-05
1.首先讓android手機監聽指定的連接埠:這一步需要使用shell,因此手機上要有終端模擬器,不過網上很多,隨便找個就行了,依次敲入下列幾行:su//擷取root許可權setprop service.adb.tcp.port 5555//設定監聽的連接埠,連接埠可以自訂,如5554,5555是預設的stop adbd//關閉adbdstart