Time of Update: 2018-12-04
ndroid 對中文字型支援很不好~~ 需要加入相應的字型庫(1)建立布局Layout//建立線性布局 LinearLayout
Time of Update: 2018-12-04
參考APIDEMOS裡面的 BitmapDecode.java 對R.drawable.animated_gif的支援 @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(new SampleView(this)); } private static class
Time of Update: 2018-12-04
關閉軟鍵盤 private void hideInputSoft() { try { InputMethodManager imm = (InputMethodManager) mContext.getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(mContext.getWindow().getDecorView().getWindowToken(), 0); } catch
Time of Update: 2018-12-04
package com.cardroid.textView; import android.content.Context; import android.graphics.Canvas; import android.graphics.Rect; import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.view.KeyEvent; import
Time of Update: 2018-12-04
重寫listview,通過監聽滑動事件,根據滑動時所處的位置,以及滑動的方向,使用view的內建scrollTo或scrollBy函數來移動view到你手勢互動的距離(此處為一半),然後當確定消費了給事件後,又復原到(0,0)點。當然只有在超出了邊界時才復原。而且復原的過程由TranslateAnimation來控制,這樣的好處在代碼的解釋中。我是基於網路上的listviewpress改了一些(有幾處好像是被篡改了,我又按我的理解將它改正過來,運行後沒問題)。一下是關鍵的代碼,整個代碼見附件中。
Time of Update: 2018-12-04
痛苦了這麼久,還是有收穫的。。。自訂listview,每個item包含一個TextView和一個Button,然後想每次點擊後,改變button背景,改變後。等到下次再開啟,也變化了,也就是說要保留改變後的狀態。。。listItemView.xuebutton.setBackgroundResource((Integer)
Time of Update: 2018-12-04
建立View:import android.content.Context;import android.graphics.Canvas;import android.graphics.Color;import android.graphics.Paint;import android.graphics.Rect;import android.graphics.RectF;import android.view.View;public class MyView extends
Time of Update: 2018-12-04
package com.android;import java.util.ArrayList;import java.util.HashMap;import java.util.Iterator;import java.util.List;import java.util.Map;import java.util.Map.Entry;import org.ksoap2.SoapEnvelope;import org.ksoap2.serialization.SoapObject;import
Time of Update: 2018-12-04
android 不同activity之間傳遞對象有兩種方式:Bundle 的 1) public void putSerializable(String key, Serializable value) ; 2)public void putParcelable(String key, Parcelable value)所以傳遞類需要 implements Serializable 或者 implements Parcelable 即可。一)implements Serializable
Time of Update: 2018-12-04
All below build steps are trivial, but i took like a week to get a grip of.. just documenting to be handy.$MYDROID is root of your android source directory.Quick Incremental BuildSetup the environment for your build setup, go to moudle's directory
Time of Update: 2018-12-04
一是在OnCreate中(放在set表單前): requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
Time of Update: 2018-12-04
http://blog.csdn.net/javasecret/article/details/7579698 很多人在項目中做長時間操作時,比如訪問web service後台資料,都想顯示一個透明無邊框的圓形進度條,如: 不幸的是,Android系統內建的ProgressDialog,無論如何設定Theme、style,或者用java代碼設定什麼屬性,邊框都是去不掉的,至少我現在還不知道怎麼去掉: 怎麼辦?
Time of Update: 2018-12-04
1.manifest中添加permis: <uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" /> 2.建立shortcut的intent: Intent shortcut = new Intent(
Time of Update: 2018-12-04
原文連結:http://blog.csdn.net/zhangxaochen/article/details/8010634一直不知道 preloadEffect 函數作用,只是猜想可能會提高程式啟動效率之類的。結果今天居然碰上了用例o(╯□╰)o看這裡:
Time of Update: 2018-12-04
首先,我們明確,preference是和資料存放區相關的。 其次,它能協助我們方便的進行資料存放區!為什麼這個地方一定要強調下方便的這個詞呢?原因是,我們可以根本就不使用,我們有另外的N種辦法可以實現同樣的功能!它的出現,相當於為我們提供了一個方便的工具,當然了,這個工具並不是必須的。 preference都應用在什麼情境呢?
Time of Update: 2018-12-04
一、什麼是Surface 簡單的說Surface對應了一塊螢幕緩衝區,每個window對應一個Surface,任何View都要畫在Surface的Canvas上(後面有原因解釋)。傳統的view共用一塊螢幕緩衝區,所有的繪製必須在UI線程中進行。 在SDK的文檔中,對Surface的描述是這樣的:“Handle onto a raw buffer that is being managed by the screen
Time of Update: 2018-12-04
編譯linphone-android遇到不少問題,記錄下來,備用。1.下載代碼,我是通過git下載的,http://www.linphone.org/eng/download/git.htmlgit clone git://git.linphone.org/linphone-android.git --recursive這個只是主工程,下面有好幾個子工程,即submodule,如果下載順利,會自動把子工程一起下載。代碼較大,下載後加上.git約500M,建議下載時找個網速較好的電腦。但如果出錯,
Time of Update: 2018-12-04
工程代碼:http://download.csdn.net/detail/victoryckl/4610617 在apk中,有時候需要root許可權,例如通過apk更新系統庫等system的檔案等,避免升級韌體,或者在apk中需要直接存取某些裝置等。下面是在apk中擷取root許可權的方法,前提是裝置已經root過了。 關鍵點在於下面這句,通過執行su產生一個具有root許可權的進程:Process p =
Time of Update: 2018-12-04
http://www.cnblogs.com/mainroadlee/archive/2011/01/11/Android_Network_State_Checking_And_Setting.html擷取網路連接狀態隨著3G和Wifi的推廣,越來越多的Android應用程式需要調用網路資源,檢測網路連接狀態也就成為網路應用程式所必備的功能。Android平台提供了ConnectivityManager
Time of Update: 2018-12-04
Win xp 系統 工作列上顯示了正在啟動並執行模擬器,但是點擊它,始終看不到模擬器顯示出來。用Alt + Tab 切換也不行。在網上查了下,大概有幾種方法:1.重新裝一下ADT,據說有效果,結果有人天天重裝ADT。2.在啟動自己的AVD時,把“Scale display to real