Time of Update: 2018-12-05
針對以前修改的,進行了再修改。這次就能很好的實現了長按,然後向下拖動,背景的Item也向上的效果。注要對如下函數進行了修改:private void onDrag(int x, int y){if (dragImageView != null){windowParams.alpha = 0.6f;windowParams.x = x - dragPointX + dragOffsetX;windowParams.y = y - dragPointY + dragOffsetY;// L.l("=
Time of Update: 2018-12-05
Android中View的onClick是獨立的,即一個View處理了onClick後訊息不會傳遞給父View的onClick,不處理也不會傳遞!onClick處理後甚至不會調用onItemClick!想想這是有道理的。onLongClick也是獨立的,子View無論處不處理該訊息都不會傳遞給父View。onLongClick處理後會不會調用onItemLongClick與其傳回值有關,item的onLongClick返回false時才會調用onItemLongClick。onLongClick
Time of Update: 2018-12-05
AndroidManifest.xml檔案中,<activity>元素是使用頻率最高的元素,該元素宣告了應用中的活動(Activity)。常用的形式如下: <activity android:label="@string/app_name" android:name=".HelloAndroidActivity"
Time of Update: 2018-12-05
java程式段:setContentView(R.layout.index); TabHost tabHost = (TabHost) findViewById(R.id.tabhost); // 如果沒有繼承TabActivity時,通過該種方法載入啟動tabHost tabHost.setup();
Time of Update: 2018-12-05
The <uses-permission> Element 我們現在告別<application>元素,回到<manifest>中定義的子項目,<uses-permission>就是我們接下來要討論的其中一個元素。
Time of Update: 2018-12-05
1、首先你的電腦要安裝好git,這個請參考git官網。2、開啟git命令視窗輸入git clone http://android.git.kernel.org/platform/frameworks/base android(此處為你自訂的檔案夾名稱,我們這裡叫android),我曾試過git clone
Time of Update: 2018-12-05
接上篇~<activity>元素 現在我們來電有趣的。這裡有一個叫Mr. Nom的例子: <activity android:name=".MrNomActivity" android:label="Mr. Nom" android:screenOrientation="portrait">
Time of Update: 2018-12-05
什麼是OPenGL ES ,我們為什麼要關注它 OpenGL ES 是OpenGL的子集,它是一個3D繪圖編程的標準。他尤其適用於行動裝置和嵌入式裝置。它屬於Khronos集團,Khronos集團包括了ATI,NVIDIA和Intel等公司,這些公司共同定義和擴充了OPenGL標準。 說起OPenGL ES,它現在有3個版本:OPenG1.0,OpenG1.1,OpenG2.0。本書只是用前兩個版本。所有的Android裝置都支援OpenGL1.0,大多數支援OpenGL1.1
Time of Update: 2018-12-05
首先根據http://source.android.com/download網頁上的描述可知,源碼大概有2.1GB,需要6GB空間才能編譯,因為我是在虛擬機器上裝的Ubuntu9.10,所以虛擬機器至少要有10GB空間。粗體,底線部分是我安裝中遇到的一些問題,或者重點關注的地方 首先需要安裝開發環境,需要如下包:Required Packages:Git 1.5.4 or newer and the GNU Privacy Guard. JDK 5.0, update 12 or
Time of Update: 2018-12-05
1:從A--Activity到達B--ActivityIntent intent = new Intent();intent.setClass(BundleDemoActivity.this, otherActivity.class);2:從A--Activity傳輸資料到B--ActivityIntent intent = new Intent();intent.setClass(BundleDemoActivity.this, otherActivity.class);Bundle
Time of Update: 2018-12-05
取得螢幕大小:DisplayMetrics dm = new DisplayMetrics();getWindowManager().getDefaultDisplay().getMetrics(dm);dm.widthPixels;dm.heightPixels;使用樣式表:在res/values下面建一張style.xml<?xml version="1.0" encoding="utf-8"?><resources><style
Time of Update: 2018-12-05
之前在網上找了很多都沒有這方面的資料,大概的效果是當Gallery滑動時不下載圖片,當Gallery滑動停止時載入當前頁面圖片,自己花了一點時間大概的實現了,如果各位有更好的意見歡迎說出來大家一起學習。先看看效果:這圖是在載入圖片時顯示的預設圖片,當圖片載入完成則替換。圖片載入完成import java.util.ArrayList;import java.util.HashMap;import java.util.List;import android.app.Activity;import
Time of Update: 2018-12-05
在 Android 上使用 Intent 開啟視頻連結的問題 Intent intent = new Intent(Intent.ACTION_VIEW); intent.setDataAndType(Uri.parse("http://www.yourvideo.mp4"), "video/mp4"); view.getContext().startActivity(intent); 檢測 Android 中的某個 Intent 是否有效public static boolean
Time of Update: 2018-12-05
對自己現在所瞭解的layout_weight屬性進行記錄,不求全面,只求正確!layout_weight意為"權重",我的理解就是給組件設定一個顯示大小的比例。layout_weight設定一個值,會出現兩種情況。第一種:當組件的“layout_width”屬性為“fill_parent”時,值越小,組件越大。第二種:當組件的“layout_width”屬性為“wrap_content”時,值越大,組件越大。第一種情況:Xml代碼 <LinearLayout
Time of Update: 2018-12-05
Activity載入模式standard: 標準模式,一調用startActivity()方法就會產生一個新的執行個體。
Time of Update: 2018-12-05
布局:main.xml:<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content"
Time of Update: 2018-12-05
在網上收集到了TextView 的屬性,在開發過程中還是挺有用的。android:autoLink設定是否當文本為URL連結/email/電話號碼/map時,文本顯示為可點擊的連結。可選值(none/web/email/phone/map/all)android:autoText如果設定,將自動執行輸入值的拼字糾正。此處無效果,在顯示IME並輸入的時候起作用。android:bufferType指定getText()方式取得的文本類別。選項editable
Time of Update: 2018-12-05
URL fileURL = null;Bitmap bitmap = null;try {fileURL = new URL(picUrl);} catch (MalformedURLException err) {err.printStackTrace();}try {HttpURLConnection conn = (HttpURLConnection)
Time of Update: 2018-12-05
最近在學貝茲路徑,在網上找了些文章,感覺都不怎麼樣,就在前輩的基礎上進行了些修改。下面貼出代碼:【改天貼上很美的】MySurfaceView.javapackage mojia.main;import java.util.Random;import android.content.Context;import android.graphics.Canvas;import android.graphics.Color;import android.graphics.Paint;import
Time of Update: 2018-12-05
可以開機啟動一個服務進行動態註冊優先順序設定最大值:android:priority="2147483647"