原创 記一個 結合 listview asynctask json 網絡請求的 分頁操作
public class Fragment1 extends Fragment { private ListView listview; private MyListSdapt adapt; private String path
原创 ViewDragHelper使用模板
public class DragViewGroup extends FrameLayout { private ViewDragHelper mViewDragHelper; private View mMenuVie
原创 安卓羣英傳 _個人筆記
第三章: 1.Activity phoneView decorView titleView contentView requestWindowFeature(Window.Feature_no_title)設置全屏,必須在setCon
原创 記 onSaveInstanceState(Bundle)
一些配置發生改變的時候,入屏幕旋轉 要保存數據 用到改方法 然後根據判斷oncreate方法判斷裏面的參數是否爲空 不爲空則 提取
原创 記一個 dp,sp區別
dp(dip) 意爲密度無關像素。在設置邊距,內邊距或任何不打算按像素指定尺寸的情況下,通常都是用dp這種單位。如果設備屏幕密度較高,密度無關像素會相應擴展至整個屏幕。 1dp單位在設備屏幕上總是等於1/160英寸。使用dp的好處是,無論
原创 當不知道哪錯了,使用 Log(String ,String,Exception)可以追棧查錯
當不知道哪錯了,使用 Log(String ,String,Exception) public class MainActivity extends Activity implements OnClickListener { priv
原创 messenger,client和server通信Demo
</pre><p>Server</p><p></p><p><pre name="code" class="java">public class MessengerService extends Service { private H
原创 記一個viewpager,用到網絡取數據,回調,設置滑動
fragment中 public class Fragment1 extends Fragment { private String imgage="http://192.168.11.57/my/cookbook_hongshairo
原创 安卓4.4以前不能直接調用js獲取返回值,解決方法
安卓4.4以前用類似這種調用js獲得返回數據 webView.evaluateJavascript("getGreetings()", new ValueCallback<String>() { @Override publi
原创 記一個JSON解析,客戶端,服務端
安卓端 package com.example.httprequest; import java.io.IOException; import java.util.ArrayList; import java.util.List;
原创 實現一個簡單的自定義Dialog彈窗。
自己看了一些資料之後,這個是自己算是第一個比較有點用的自定義控件了吧。 謝了這個之後,對接口回調的理解也有一定的幫助。 不說了,貼代碼。比較懶,偷懶了很多。 //這裏注意,oncreate方法在dialog.show()之後纔會運
原创 ViewPager 兩邊顯示部分其他頁
主要就是設置margin,Viewpager父節點設置 android:clipChildren="false" viewpager.setpag
原创 記一個 bitmap位圖壓縮。
package com.example.decodebitmap; import android.content.res.Resources; import android.graphics.Bitmap; import android
原创 記一個 sharepreferences
public class StoreHelper { private SharedPreferences sp; public StoreHelper(Context context,String name,int model
原创 Service裏常駐Notification,可以在後臺低內存的時候不被kill
public class MyService extends Service { private Notification nf; private NotificationManager nfm; private MyAIDL.St