今天想讓按鍵暫時無效,滿足一定條件下才可以被使用者按到。最初以為是setClickable,誰知搞錯了。請看手冊:複製代碼 代碼如下:public void setClickable (boolean clickable)Since: API Level 14Sets whether this node is clickable.Note: Cannot be called from an AccessibilityService. This class is made immutable
這是個很簡單的問題,但每次隔一段時間後使用起來總是會出點亂子。這裡記錄下Logcat的步驟:1,在Activity裡申明tag變數(名字其實是隨便的,如下:private static final String tag="yan";2,需要使用logcat輸出資訊時:Log.i(tag, "螢幕寬度:"+display.getWidth()+" 螢幕高度:"+display.getHeight());3, 雙擊Logcat,點擊“+”號add a new logcat
很多Android手機上都配有LED燈,比如HTC的手機在充電、新來簡訊等時候都會有響應的指示,其實很簡單的這都是NotificationManager的一些參數而已,下面Android123給大家說下如何通過代碼控制LED燈的閃爍,因為有些機型沒有LED燈或顏色種類較少,發布時需要真機觀察。 複製代碼 代碼如下: final int ID_LED=19871103;
如果想在自訂的View上面顯示Button 等View組件需要完成如下任務 1.在自訂View的類中覆蓋父類的構造(注意是2個參數的)複製代碼 代碼如下: public class MyView2 extends View{ public MyView2(Context context,AttributeSet att) {super(context,att); } public void onDraw(Canvas c) { //
模擬器(emulator.exe)可以在 Android SDK 的安裝目錄下的 tools 檔案夾找到運行檔案(F:GPhoneandroid-sdk-windows-1.0_r1 ools),雙擊運行模擬器。安裝 APK 包adb install [-l] [-r] - push this package file to the device and install it<'-l' means forward-lock the app><'-r' means
去掉標題列:requestWindowFeature(Window.FEATURE_NO_TITLE);API上是這麼說的:int FEATURE_NO_TITLE Flag for the "no title" feature, turning off the title at the top of the