Time of Update: 2016-07-30
Android 中BaseActivty,androidbaseactivtyBase介面IBaseActivitypackage liu.basedemo.base;/** * 基類介面 * Created by 劉楠 on 2016/7/28 0028.23:05 */public interface IBaseActivity { /** * 返回視圖的布局(setContentView中使用) * @return 返回視圖的布局 */ int
Time of Update: 2016-07-30
[android] 練習使用ListView(二),androidlistview主要練習非同步任務和LrcCache緩衝package com.android.test;import java.io.InputStream;import java.net.HttpURLConnection;import java.net.URL;import com.nostra13.universalimageloader.core.ImageLoader;import
Time of Update: 2016-07-28
[android] 練習使用ListView(一),androidlistview練習使用ListView,BaseAdapter,先展示文字的,再練習圖片的MainActivity.javapackage com.android.test;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.view.ViewGroup;import
Time of Update: 2016-07-30
Android 中MyApplication,myapplicationpackage liu.basedemo;import android.app.Activity;import android.app.Application;import java.lang.ref.WeakReference;import java.util.Stack;/** * MyApplication應用 基本 * Created by 劉楠 on 2016/7/28 0028.21:45 */public
Time of Update: 2016-07-28
Activity的四種啟動模式,activity四種模式Activity的四種啟動模式我們在項目開發的過程中,會涉及到應用中各個Activity的跳轉,有些Activity是可以複用,不用重複載入,節約記憶體的使用.將第二個Activity的啟動模式修改掉,這些啟動模式可以在功能資訊清單檔AndroidManifest.xml中進行設定中的launchMode屬性。1). starndard 標準的任務棧模式 按照一一排列的方式(預設啟動模式)2). singleTop
Time of Update: 2016-07-27
AlertDialog的六種建立方式,alertdialog六種 AlertDialog的六種建立方式建立AlertDialog的步驟: 1、建立AlertDialog.Builder對象 2、調用Builder對象的setTitle方法設定標題,setIcon方法設定表徵圖 3、調用Builder相關方法如setMessage方法、setItems方法、setSingleChoiceItems方法、setMultiChoiceItems方法、setAdapter方法、setVi
Time of Update: 2016-07-27
(轉)postman中 form-data、x-www-form-urlencoded、raw、binary的區別,postmanbinary1、form-data:
Time of Update: 2016-07-26
[android] 練習viewpagerindicator的使用(一),viewpagerindicator主要是學習一下使用這個庫activity_main.xml<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
Time of Update: 2016-07-27
Android開發常見錯誤類型一覽表,android常見錯誤這是我的第一個部落格,我會一直添加我在Android開發中遇到的錯誤,用來記錄我開發中踩過的那些坑------------------------分割線-------------------------------------ClassCastException 類型轉換錯誤 常發生在找到某個東西時,強轉RemoteException:無法建立遠程服務串連syntax :語法錯誤 Error:Execution
Time of Update: 2016-07-25
Android,androiddeveloper實現android雙擊後退鍵退出當前APP功能實現該功能基本思路是,1, 監聽後退鍵 , 比較兩次後退間隔 , 低於兩秒則出發退出2, 退出當前APP 我選擇在基類中BaseActivity 中設定監聽,代碼如下:@Override public void onBackPressed() { //Preferences 中擷取是否雙擊退出 boolean isDoubleClick = true;
Time of Update: 2016-07-26
Android ViewPager設定監聽注意事項,androidviewpager首先 implements View.OnClickListener因為Item比較多用這個方便設定監聽要注意地方,如果在 onCreate 直接 findViewById布局裡的ID是會出錯的參考下面代碼 private void initAllViewPager() { viewpager = (ViewPager)
Time of Update: 2016-07-25
Android 開發筆記——通過 Intent 傳遞類對象,androidintentAndroid中Intent傳遞類對象提供了兩種方式一種是 通過實現Serializable介面傳遞對象,一種是通過實現Parcelable介面傳遞對象。要求被傳遞的對象必須實現上述2種介面中的一種才能通過Intent直接傳遞。Intent中傳遞這2種對象的方法:Bundle.putSerializable(Key,Object);
Time of Update: 2016-07-25
Android資料庫相關整理,android資料庫清理今天對Android中資料庫相關的操作和代碼做了一個整理,便於自己之後的查閱。主要內容有:1.原生資料庫寫法2.終端進sqlite的操作3.第三方庫4.交易處理5.許可權和路徑 一、原生資料庫寫法一般要先繼承自SQLiteOpenHelper寫一個Helper。public class DatabaseHelper extends SQLiteOpenHelper { private static final
Time of Update: 2016-07-23
android 網路_網路源碼查看器,android源碼xml設計<?xml version="1.0"?>-<LinearLayout tools:context=".MainActivity" android:paddingTop="@dimen/activity_vertical_margin" android:paddingRight="@dimen/activity_horizontal_margin"
Time of Update: 2016-07-22
android學習——LinearLayout線性布局,linearlayout布局LinearLayout線性布局 LinearLayout是一種線型的布局方式。LinearLayout版面配置容器內的組件一個挨著一個地排列起來:不僅可以控制個組件橫向排列,也可控制各組件縱向排列。通過orientation屬性設定線性排列的方向是垂直(vertical)還是縱向(horizontal)。 我們下面通過XML布局和Java代碼布局兩種方式分別舉例:一、XML方式布
Time of Update: 2016-07-22
[android] 練習樣式主題自訂activity切換動畫,androidactivity主要練習了自訂樣式和主題,繼承android系統預設的樣式並修改,練習xml定義淡入淡齣動畫anim/fade_in.xml<?xml version="1.0" encoding="utf-8"?><alpha xmlns:android="http://schemas.android.com/apk/res/android" android:duration="3000"
Time of Update: 2016-07-22
Android開發中用友盟做分享的一些坑,android用友僅限於用5.1.4版本的按照友盟分享的API在自己的代碼中修改:1.分享需要打包APK檔案,數位簽章與開發申請的要一致2.此name中屬性不能修改 value為友盟的申請的appkey <meta-data android:name="UMENG_MESSAGE_SECRET" android:value="******************************"
Time of Update: 2016-07-22
定時重複執行一個任務,重複執行任務使用到的方法:Timer.schedule()TimerTask()第一個方法裡面有三個參數,分別為:任務(task),延時(delay),周期(period)延時和周期使用的單位是毫秒。 1 private Timer mTimer = new Timer(); 2 private void timerTask(){ 3 mTimer.schedule(new TimerTask() { 4 @Override 5 public void run() { 6
Time of Update: 2016-07-21
xml的產生與解析_老師筆記,xml解析老師筆記使用序列化器產生一個xml檔案 //1,初始化一個xml檔案的序列化器 XmlSerializer serializer = Xml.newSerializer(); //2.初始化序列器參數 File file = new File(Environment.getExternalStorageDirectory(),"backup.xml");
Time of Update: 2016-07-22
android ListView_顯示資料庫資料,androidlistviewxml<?xml version="1.0"?>-<LinearLayout tools:context=".MainActivity" android:orientation="vertical" android:paddingTop="@dimen/activity_vertical_margin"