Time of Update: 2013-12-11
Time of Update: 2013-12-11
通過ByteArrayOutputStream將inputStream轉變為outputStream 1.首先,先編寫一個擷取檔案輸入資料流的方法 ops()。2. 之後在調用此方法獲得輸入資料流,並通過 castToBAOStream(Object obj,int bufferSize)進行轉化。3.最後,寫出 轉化成功的
Time of Update: 2013-12-11
網狀圖片查看器清單文加入網路存取權限:view plain|<!-- 訪問internet許可權 --> <uses-permission android:name="android.permission.INTERNET"/> 介面如下: 樣本:view plain<span style="FONT-WEIGHT: normal">public class
Time of Update: 2013-12-11
像列表這種選擇項的彈出式對話方塊,要改變樣式一般都採取重寫layout方式 今天才瞭解到 其實可以自訂樣式,與大家分享下,其實很簡單 AlertDialog.Builder builder = new AlertDialog.Builder(new ContextThemeWrapper(this, R.style.AlertDialogCustom)); 然後自訂自己的樣式就可以了 <?xml
Time of Update: 2013-12-11
1.最簡潔的方法 使用類 android.provider.ContactsContract.CommonDataKinds.Phone; 代碼如下: Cursor c = getContentResolver().query( ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null, null,
Time of Update: 2013-12-11
前一段時間研究android, 在jni端操作surface遇到麻煩,主要是C++基礎太差,Surface.cpp讀了n遍,也仿照網上查到的資料,試圖從Java端傳遞Surface,然後jni端進行操作。卻總是遇到各種各樣的異常,前前後後卡住了7天,最後終於解決了,放出這個方法,總會對部分朋友有協助。 其實不是原創的,只是,網上有1000篇文章,有999篇都講的同一種方法,但在我這裡卻偏偏成功不了。終於那天偶然看到一篇e文的文章,是有人分析了 havlenapetr 的libjnivideo.
Time of Update: 2013-12-11
什麼是操作功能表:有時候我們也可以叫做快鍵菜單。例如我們在電腦案頭右鍵所看到的菜單就是捷徑功能表,也叫操作功能表,叫操作功能表是因為Context翻譯成為內容相關的意思建立上下文ContextMenu菜單的步驟:1、 覆蓋Activity的onCreateContextMenu()方法,調用Menu的add方法添加功能表項目2、 覆蓋onContexItemSelected()方法,響應菜單單擊事件3、
Time of Update: 2013-12-11
今天來看看AudioEffect中enable相關的介面。 *****************************************源碼************************************************* //Test case 1.3: test getEnabled() failure when called on released effect
Time of Update: 2013-12-11
[java] * 非同步載入圖片 * 使用方法: * private AsyncImageLoader asyImg = new AsyncImageLoader(); * asyImg.LoadImage(productItems.get(position).getPic(), (ImageView)view.findViewById(R.id.pic)); */
Time of Update: 2013-12-11
首先上異常的: 報錯的主要原因是沒找到第三方的類。解決方案:項目右鍵Properties ------->Build Path------->Order And
Time of Update: 2013-12-11
首先還是一貫作風,我們先看案例:
Time of Update: 2013-12-11
TextView實現文字滾動需要以下幾個要點:1、文字長度長於可顯示範圍:android:singleLine="true";2、設定可滾到,或顯示樣式:android:ellipsize="marquee";3、TextView只有在擷取焦點後才會滾動顯示隱藏文字,所以可以重寫TextView類。(但是一直給予焦點可能會導致其不能被點擊,如放在listView中的時候) public class AlwaysMarqueeTextView
Time of Update: 2013-12-11
3 分鐘前 上傳下載附件 (15.45 KB) Adapter的作用就是ListView介面與資料之間的橋樑,當列表裡的每一項顯示到頁面時,都會調用Adapter的getView方法返回一個View。想過沒有? 在我們的列表有1000000項時會是什麼樣的?是不是會佔用極大的系統資源? 先看看下面的代碼: public View getView(int position, View convertView, ViewGroup parent) {View
Time of Update: 2013-12-11
在重寫View的時候,會遇到這兩個方法protected void onAttachedToWindow()Description copied from class: ViewThis is called when the view is attached to a window. At this point it has a Surface and will start drawing. Note that this function is guaranteed to be
Time of Update: 2013-12-11
今天利用canvas.drawBitmap方法畫圖片的時候發現一個問題,用2.1版本做的時候是置中顯示的,後來用2.2的時候卻發現同樣的圖片,卻不能置中顯示了。我看了,用的是同一圖片,後來想了想,估計是與版本有關係,於是就測了下,發現同樣的測試代碼,在2.1版本測出螢幕長和寬為533*320圖片的長和寬為480*320,2.2版本測出螢幕長和寬為800*480圖片的長和寬為720*480. 看到這個結果我恍然大悟了,因為My
Time of Update: 2013-12-11
首先,我前面有一片部落格寫的是android消除螢幕鎖
Time of Update: 2013-12-11
一個Android兩大資料解析(xml., join)三大提示(Dialog, Toast, Notification)四大應用程式組件(Activity, BroadcastReceiver, Service, ContentProvider)四大多媒體技術(音頻, 視頻, 網路攝影機, 鈴聲)五大布局(LineaLayout, RelativeLayout, FrameLayout, TableLayout, AbsoluteLayout)五大資料存放區(檔案儲存體,網路儲存,
Time of Update: 2013-12-11
1. ListView的OnItemClickListener不被觸發的另外一種情況 如,在一個ItemView中,只有一個TextView位於最左側,他的右側是空白地區,沒有任何控制項,當點擊右側地區時,並不會觸發OnItemClickListener,當點擊TextView所在的地區時,就能觸發這個事件。
Time of Update: 2013-12-11
效果: corner.xml [html] <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" >
Time of Update: 2013-12-11
[java] package test; import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.*; /* * 作者:鐘志鋼 * 功能:集合架構 * 時間:2013-1-26 *