Time of Update: 2013-12-10
Android Touch Screen 與傳統Click Touch
Time of Update: 2013-12-10
android:layout_below 將該控制項的頂部至於給定ID的控制項之下android:layout_toLeftOf 將該控制項的右邊緣和給定ID的控制項的左邊緣對齊android:layout_toRightOf 將該控制項的左邊緣和給定ID的控制項的右邊緣對齊android:layout_alignBottom 將該控制項的底部邊緣與給定ID控制項的底部邊緣android:layout_alignLeft
Time of Update: 2013-12-10
/** * * @author chrp * *圖片 的放大 縮小 */public class TouchImageViewActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) {
Time of Update: 2013-12-10
android系統為大家提供了adb工具,在adb的基礎上執行adb
Time of Update: 2013-12-10
系統內建的Theme:--------------------------------------------------------------------------------android以及為我們定義好了一些theme,需要是我們直接可以拿來使用。常用的Theme通常如下: android:theme="@android:style/Theme.Dialog"將一個activity顯示為對話方塊模式 android:theme=&qu
Time of Update: 2013-12-10
1. Check network statusAndroidManifest.xml<uses-sdk> ... </><uses-permission android:name="android.permission.INTERNET" /><uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"
Time of Update: 2013-12-10
JAVA 程式我們使用 sensor 介面一般只要註冊一下 SensorListener 像下面這樣**************************************************************ApiDemo: mGraphView = new GraphView(this); mSensorManager.registerListener(mGraphView,....
Time of Update: 2013-12-10
1. 進入contacts app,建立一個連絡人;2. 在連絡人姓名欄輸入如下類似欄位(目前已知):Class 1: common_name_prefixes1LT , 1ST , 2LT, 2ND, 3RD, ADMIRAL, CAPT, CAPTAIN, COL, CPT, DR, GEN, GENERAL, LCDR, LT, LTC, LTG, LTJG, MAJ, MAJOR, MG, MR, MRS, MS, PASTOR, PROF, REP,
Time of Update: 2013-12-10
Contact類 public static class Contacts implements BaseColumns, ContactsColumns, ContactOptionsColumns, ContactNameColumns,
Time of Update: 2013-12-10
最近做項目要通過圖片的絕對路徑找到圖片的URI,然後刪除圖片,小小總結一下擷取URI的方法,親自實驗在android 4.1.3的系統上都是可用的。 1.將所有的圖片路徑取出,遍曆比較找到需要的路徑,取出URI,效率較低其中 MediaStore.MediaColumns.DATA 欄位存的就是圖片的絕對路徑,最後mImageUri得到的就是圖片的URI 1 Uri mUri = Uri.parse("content://media/external/images/
Time of Update: 2013-12-10
今晚在複習Android基礎的時候,找到了一些很有價值的基礎知識,分享給給位Android的開發人員。這些是基礎知識,同時也可以當做面試準備。面試題其實是很好的基礎知識學習,有空會好好整理相關基礎知識。1.Activity的生命週期方法 描述 可被殺死 下一個 onCreate() 在activity第一次被建立的時候調用。這裡是你做所有初始化設定的地方──建立視圖、設定布局、綁定資料至列表等。如果曾經有狀態記錄(參閱後述Saving
Time of Update: 2013-12-10
public class ResizeLayout extends FrameLayout { private OnkeyboardShowListener mChangedListener; private boolean misKeyboardshow = false; private RRSharedPreferences preferences; private int keyboardHeight =
Time of Update: 2013-12-10
根據網上的代碼稍作修改了下,放著記錄學習。如下:package com.andyidea.tabdemo; import android.app.TabActivity; import android.content.Intent; import android.os.Bundle; import android.util.DisplayMetrics; import android.view.Display; import
Time of Update: 2013-12-10
前幾天做一個小應用,需要用到在service中調用Activity, 但是發現總是出現ANR,百度了下,發現各種說法,不過經過嘗試,發現問題不大,只需要加一句代碼就足夠了,代碼如下: public class XXXService extends Service { public void onCreate() { super.onCreate(); //撥打到電話 Intent call = new Intent(&
Time of Update: 2013-12-10
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"
Time of Update: 2013-12-10
在styles裡面加<style name="transparent2" parent="@android:style/Theme.Translucent"> <item name="android:windowNoTitle">true</item> </style>然後在activity裡面加theme屬性<
Time of Update: 2013-12-10
最近在做一個項目,要求實現上下能滾動,每項能左右滾動,最後效果是實現了,可資料的通訊可能有點麻煩,暫時又被砍掉了,先放上來存檔,轉載請註明出處,謝謝代碼如下 public class GroupActivity extends Activity { private List<TeamBean> gbList;// private MyListAdapter adapter; private ItemClickEvent listener;//
Time of Update: 2013-12-10
Android中有許多隱藏的Service,StatusBarManager就是其中一個,在Context.java中可以看到:[java]/** * Use with {@link #getSystemService} to retrieve a {@link * android.app.StatusBarManager} for interacting with the status bar. * * @see
Time of Update: 2013-12-10
android的橫豎屏切換,也會發生不少問題。1. 鎖定螢幕方向,禁止切換:在AndroidManifest.xml中的Activity參數中加上 android:screenOrientation="landscape" 保持橫屏OR android:screenOrientation="portrait"
Time of Update: 2013-12-10
ImageView沒有邊角圓化的設定,但是可以通過代碼設定實現。一個國外的碼農寫的方法。 package com.example.roundrectshader; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import