原创 android RotateAnimation使用

RotateAnimation (float fromDegrees, float toDegrees, int pivotXType, float pivotXValue, int pivotYType, float pivotYVa

原创 SimpleDateFormat 使用說明

 /* G 年代標誌符   y 年  M 月  d 日  h 時 在上午或下午 (1~12)  H 時 在一天中 (0~23)  m 分  s 秒  S 毫秒  E 星期  D 一年中的第幾天  F 一月中第幾個星期幾  w 一年中第幾個

原创 android 讓自己的app成爲launcher

在androidMaifest.xml添加:                 <category android:name="android.intent.category.HOME" />                 <catego

原创 android ScrollView滾動到底部

只做記錄,方便日後再遇到相似的問題可以回顧 下面是佈局文件: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tool

原创 android studio 添加assets目錄

在src/main創建目錄assets,src/main/assets 在app.iml添加 <option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" /

原创 android style設置控件樣式

以下是要使用的四個文件 normal_default.xml <shape xmlns:android="http://schemas.android.com/apk/res/android"> <corners android:

原创 android 開機自啓動

向系統註冊一個broadcastReceiver,接收開機系統發送的廣播 創建一個broadcastReceiver: public class BootBroadcastReceiver extends BroadcastReceiv

原创 android 禁用返回鍵代碼片段

/** * 禁用返回鍵 * 當用戶按返回鍵的時候,將應用切換到後臺運行 * @param keyCode * @param event * @return */

原创 android actionBar右上角 menu 顯示三個點

 在onCreate添加以上代碼 try { ViewConfiguration config = ViewConfiguration.get(this); Field menuKey

原创 android 刪除目錄(實例)

首先要添加權限: <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> 代碼: public static void deleteFile

原创 android 指南針實例

    在onCreate 得到SensorManger實例 private SensorManager sensorManager = null; sensorManager = (SensorManager) getSyste

原创 android TextView 跑馬燈效果

<TextView android:text="1234567890qazxswedcvfrrtgbthndghsdfaldfhadnscn" android:singleLine="true"

原创 android 實現手機搖一搖功能

實現接口SensorEventListener public abstract class ShakeListenerUtils implements SensorEventListener { public Contex

原创 Android 3d翻轉動畫(實例)

    原理以後再說,主要使用android的camera實現     實現動畫的類後面再給出來,先上使用代碼,體現一下這東西使用有多麼容易 代碼的功能:點擊這個ID爲hello的textView,它就開始3D翻轉 activity_

原创 android 列表對話框

package com.juxuny.taiya.api; import android.app.AlertDialog; import android.content.Context; import android.content.D