Time of Update: 2017-05-11
Fragment 重疊 遮蓋問題,fragment遮蓋1.導致Fragment 重疊 和遮蓋的原因 主要還是因為Fragment的狀態儲存機制,當系統記憶體不足時,Fragment的主Activity被回收,Fragment的執行個體並沒有隨之被回收。Activity被系統回收時,會主動調用onSaveInstance()方法來儲存視圖層(View
Time of Update: 2017-05-10
Android開發筆記(5)——方法調用(基礎),android筆記轉載請註明——部落格園igoslly:http://www.cnblogs.com/igoslly/p/6833544.html 在實際方法調用中,程式按順序逐句執行,直到“}”結束。為避免程式大量重複的代碼(如相同的布局設定、相同的功能),往往將重複的代碼定義為新的方法,如display()、displayPrice(),在原主體方法中我們只需進行調用即可。執行順序如下:1、定義方法 調用範圍:public公用函數&
Time of Update: 2017-05-11
Android開發筆記(6)——類的設定與繼承,android筆記轉載請註明http://www.cnblogs.com/igoslly/p/6838991.html 【類】的設定與繼承當設定相同格式的TextView時,已提出在styles.xml自訂格式統一TextView格式,類似【類】即為自訂方法來統一同類型的變數。 1、定義【類】圖設定了一個名為TextView的【類】,【類】看作【模板】以TextView類命名可命名多個對象(不同ID),應用【類】設定的格式和函數
Time of Update: 2017-05-04
談談App的混合開發,App混合開發一、概念App混合開發,顧名思義,是一個開發模式,指的是開發一個App一部分功能用native構建一部分功能用html5構建,英文名叫:Hybrid
Time of Update: 2017-05-08
SharedPreferences詳解,sharedpreferences原文連結:http://blog.csdn.net/zhang31jian/article/details/23258065擷取SharedPreferences的兩種方式:1 調用Context對象的getSharedPreferences()方法2
Time of Update: 2017-05-07
安卓OKhttp請求封裝,安卓okhttp封裝 目前安卓開發中使用的網路工具為OKhttp,但是okhttp的使用還不是很方便,在okhttp的基礎上再對請求進行封裝會極大的方便網路調用。 下面直接上代碼。請求封裝public class HttpUtil { public static void sendOKHttpRequest(String address, Map<String,String> head,Map<String,String>
Time of Update: 2017-05-07
androidj基礎:從網上下載圖片,一、布局檔案設定介面,添加一個ImageView,和兩個Button按鈕,設定其屬性及id <ImageView android:id="@+id/ImageView" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_centerInParent="true"
Time of Update: 2017-05-05
技術貼匯總,技術匯總打包idea匯出可執行jar包http://blog.csdn.net/aotian16/article/details/52198378aapt的常用命令http://blog.csdn.net/androidzhaoxiaogang/article/details/8246713 源碼分析Android
Time of Update: 2017-05-07
匿名社交1--登陸,匿名社交1--1.登入功能使用者登陸使用手機號+簡訊驗證碼的方式登陸,伺服器端並不儲存使用者手機號。登陸成功後用戶端可以擷取到登陸標識,用戶端可以通過登陸標識保持相對長時間的訪問伺服器的許可權。 2.介面 獲得驗證碼:{\"status\":1}匿名Login:{\"status\":1,\"token\":\"asdasdasdsadasd\"} 3.代碼MainActivity@Overrideprotected void
Time of Update: 2017-05-03
Cheatsheet: 2017 04.01 ~ 04.30,cheatsheet04.30Other ReactXP - A LIBRARY FOR BUILDING CROSS-PLATFORM APPS Merging vs. Rebasing Better Git configuration Stack Overflow's Annual Developer Survey 68 Resources for Creating Programming
Time of Update: 2017-05-06
onSaveInstanceState和onRestoreInstanceState觸發的時機,onsaveinstancestate先看Application Fundamentals上的一段話: Android calls onSaveInstanceState() before the activity becomes vulnerable to being destroyed by the system, but does not bother calling
Time of Update: 2017-05-05
利用GridView實現單選效果,gridview實現單選1.實現的單選效果由於Android提供的選項按鈕radiobutton只能單行或單列顯示,且樣式並不美觀,故可用GridView進行改造,實現單選效果,而要實現這樣的效果重點就在GridView的適配器這塊了。首先是GridView的item的XML:<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
Time of Update: 2017-05-03
策略模式,java策略模式public class TravelStrategy { enum Strategy{ WALK,PLANE,SUBWAY } private Strategy strategy; public TravelStrategy(Strategy strategy){ this.strategy=strategy; } public void
Time of Update: 2017-05-01
在Android上Kotlin的單元測試(KAD22),kotlinkad22作者:Antonio Leiva時間:Apr 25,
Time of Update: 2017-04-30
常用的adb命令,常用adb命令1、adb devices 查看裝置 這個命令是查看當前串連的裝置, 串連到電腦的android裝置或者模擬器將會列出顯示()只提示“List of devices attached” 沒有羅列裝置,兩種情況下遇到過這個問題:(1)手機設定導致,確定手機已經串連到電腦上,且手機 “設定->開發人員選項->開發人員選項”和“USB調試”為開啟狀態,在“是否允許USB調試”點擊確定;(2)adb版本太老了,更新一下到最新的版本試試。2、
Time of Update: 2017-04-30
實現在矩形框中輸入文字,可以顯示剩餘字數的功能,矩形字數如: 要實現上面的功能,需要做到三點:1、實現矩形框布局思路就是矩形框作為整個布局的一個background,在drawable中建立一個shap.xml樣式檔案<?xml version="1.0" encoding="utf-8"?><shape xmlns:android="http://schemas.android.com/apk/res/android"
Time of Update: 2017-04-27
解析View的getDrawingCache方法,getdrawingcache1. View 的getDrawingCache方法 有時候需要將某個view的內容以圖片的方式儲存下來,感覺就和差不多,可以使用View 的getDrawingCache方法,返回一個Bitmap對象。2. View的getDrawingCache的具體實現 查看View的getDrawingCache()方法/** * <p>Calling this method is equivalent
Time of Update: 2017-04-25
android 完全解析類比遙控器按鍵,android遙控器public class VirturlKeyPadCtr {private static Instrumentation mInstrumentation;public static void RC_ConttrollerAction(final int keyValue) {/** * Wrapper-function taking a KeyCode. A complete KeyStroke is DOWN and UP *
Time of Update: 2017-04-25
介面底部Tab實現,介面Tab實現現在基本上大部分的手機APP都要實現底部Tab,底部實現Tab的實現方式有很多種,那麼有沒有好的實現方式呢?今天我將使用一個開源外掛程式來實現底部Tab參考自zhangli_的部落格:http://blog.csdn.net/zhangli_/article/details/52604699(大家如果有製作gif的好方法可以推薦給我) 實現步驟如下:1.添加依賴2.在布局檔案中添加tab容器3.初始化UI4.添加tab控制碼 1.添加依賴co
Time of Update: 2017-04-25
從源碼角度入手實現RecyclerView的Item點擊事件,recyclerviewitem 轉載請註明出處:http://www.cnblogs.com/cnwutianhao/p/6758373.html RecyclerView 作為 ListView 和 GridView 的替代產物,相信在Android界已廣為流傳。 RecyclerView 本是不會有類似 ListView