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-25
ViewPager之引導頁,viewpager引導一、概述ViewPager是android-support-v4中提供的類,它是一個容器類,常用於頁面之間的切換。本文介紹ViewPager最基礎的應用:在多個View之間進行切換,亦即ViewPager的每個頁面是個View。這種模式適合每個頁面的邏輯較為簡單的情況,比如去實現“小紅書”引導頁這樣的效果: 二、實現思路2.1
Time of Update: 2016-07-26
Android ViewPager裡的所有圖片設定監聽開啟同一活動顯示不同圖片,Android ViewPager裡的所有圖片設定監聽請看前一文章為了省時所以2層菜單只做一個點擊任意圖片後顯示相應圖片的活動關鍵點是每個點擊對應的圖片如何傳參給顯示的活動因為只啟動一個活動,所以要把對應要顯示的圖片告訴活動,顯示圖片的代碼demoimageview = (ImageView)
Time of Update: 2016-07-26
【官方文檔】進程和線程,官方文檔線程進程和線程本文內容線程處理序間通訊當某個應用組件啟動且該應用沒有運行其他任何組件時,Android 系統會使用單個執行線程為應用啟動新的 Linux 進程。預設情況下,同一應用的所有組件在相同的進程和線程(稱為“主”線程)中運行。 如果某個應用組件啟動且該應用已存在進程(因為存在該應用的其他組件),則該組件會在此進程內啟動並使用相同的執行線程。
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-25
Android中設定TextView的顏色setTextColor,textviewsetcolortv.setTextColor(Color.parseColor("#FFFFFF"));tv.setTextColor(Color.WHITE); tv.setTextColor(Color.rgb(255, 255, 255)); //注意Color是大寫C,不是color.holo_orange_dark,這樣錯誤並沒效果的
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
用隨身碟安裝Ubuntu系統,u盤ubuntu用隨身碟安裝Ubuntu,需製作一個Ubuntu的隨身碟安裝盤,最為方便和可靠的製作方法是在Linux系統下使用dd命令,具體如下,sudo dd if=ubuntu-14.04.4-server-amd64.iso of=/dev/sdb bs=16M
Time of Update: 2016-07-24
我的Android筆記--我對安卓系統的一些瞭解,android筆記--安卓敲了這麼長時間代碼,記錄一下我對Android的一些概念,下面大部分內容來源自網路資料和官方給的文檔。 1,Android作業系統的核心屬於Linux的一個分支,具有典型的Linux調度和功能,為了Linux在行動裝置上更好的運行,Google對其進行修改和擴充,修修改改便成了現在我們所見到的Android系統。2,通常,我們使用Java程式設計語言來編寫Android項目,有時我們可能還會用到JN
Time of Update: 2016-07-23
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-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 K的假裝沈浸式,android假裝沉浸在Android 5.0之後引入了MD風格,並且狀態列沉浸也成為了一種設計習慣。而停留在之Android L之前的Android系統則不能直接實現沈浸式,這裡就介紹一下如何?Android K系列的假裝沈浸式。關於沈浸式效果,這裡隨便貼幾張圖吧 Android L Android 4.2 可以看出在Android
Time of Update: 2016-07-23
[android] 練習PopupWindow實現對話方塊,androidpopupwindow練習使用Dialog實習對話方塊package com.example.tsh;import android.app.Activity;import android.app.Dialog;import android.os.Bundle;import android.os.Handler;import android.view.MotionEvent;import android.view.View;
Time of Update: 2016-07-22
Driving the Activity Lifecycle,drivinglifecycleBefore Robolectric 2.2, most tests created Activities by calling constructors directly, (new MyActivity()) and then manually calling lifecycle methods such as onCreate(). Also widely used were a
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-22
android ListView_顯示資料庫資料,androidlistviewxml<?xml version="1.0"?>-<LinearLayout tools:context=".MainActivity" android:orientation="vertical" android:paddingTop="@dimen/activity_vertical_margin"