項目中經常碰到需要處理大圖片的問題,因為android對應用程式指派資源的限制,如果不進行相應的處理,容易造成OOM。Android處理大圖的方法:對於大圖先擷取出圖片的width和height, 然後根據view的width和height, 換算出圖片inSampleSize,,最後壓縮產生相應的圖片。其中重要的兩個參數是:/**111 * If set to true, the decoder will return null (no bitmap), but112
eclipse提示:This LinearLayout layout or its LinearLayout parent is possibly useless黃色驚嘆號警告資訊下面布局代碼: android:id="@+id/listener" android:layout_width="fill_parent" android:layout_height="wrap_content"
activity_main.xml: see the MainActivity.java:package com.example.photocolorchange;import android.os.Bundle;import android.app.Activity;import android.graphics.Bitmap;import android.graphics.BitmapFactory;import android.
以前做Android的項目要用到NDK就必須要下載NDK,下載安裝Cygwin(類比Linux環境用的),下載CDT(Eclipse C/C++開發外掛程式),還要配置編譯器,環境變數... 麻煩到不想說了,Shamoo在網上查了一下資料,發現了一個超級快配置NDK的辦法。 Step1:到Android官網下載Android的開發工具ADT(Android Development
與時間選取器對應的還有一個日期選取器(DatePicker),可以完成年、月、日的設定,此類定義如下:java.lang.Object ?android.view.View ?android.view.ViewGroup ?android.widget.FrameLayout ?android.widget.DatePicker常用方法:No.方法類型描述1public int getYear()普通取得設定的年2public int getMonth()