Time of Update: 2018-12-06
一、 Linux系統根目錄結構 目錄名描
Time of Update: 2018-12-06
學習了一個星期了,總算學會了TextView、EditView、Button等基本的控制項,還有一點點布局的知識,然後佳哥(我的師傅)就叫我寫一個打電話的東西,感覺很神奇,不過經過他的一句代碼,我覺得超容易啊~~~下面我來說下具體操作:首先看下我的成果:1、控制項的布局<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
Time of Update: 2018-12-06
雖然是小問題一個,但也困擾了我一段時間,現在記下來,給自己做個備忘,也可以給其他人一個參考。 Android.view.WindowLeaked按字面瞭解,Window
Time of Update: 2018-12-06
在android SDK文檔中有這樣一個類,android.provider.Settings類提供android系統各個頁面的跳轉常量: StringACTION_ACCESSIBILITY_SETTINGSActivity Action: Show settings for accessibility modules.StringACTION_ADD_ACCOUNTActivity Action: Show add account screen for creating a new
Time of Update: 2018-12-06
網上一搜一大把為自己的應用建立捷徑,但是本文的側重點在為“指定的應用”建立案頭捷徑。 常見的案頭捷徑有兩要素:1.應用程式名稱 2.應用表徵圖。 指定應用表徵圖的資訊是: // pkgContext為指定應用的上下文環境,iconIdentifier為一個整數,指定應用的表徵圖標識符 ShortcutIconResource iconRes = Intent.ShortcutIconResource.fromContext(pkgContext,
Time of Update: 2018-12-06
// 監聽類private final BroadcastReceiver sdcardListener = new BroadcastReceiver() { @Overridepublic void onReceive(Context context, Intent intent) { String action = intent.getAction(); Log.d("TAG", "sdcard action:::::" +
Time of Update: 2018-12-06
package com.Aina.Android;import java.io.File;import android.app.Activity;import android.content.Intent;import android.media.RingtoneManager;import android.net.Uri;import android.os.Bundle;import android.os.Environment;import android.view.View;import
Time of Update: 2018-12-06
Adapter是listview和資料來源間的中間人。當每條資料進入可見地區時,adapter的getview()會被調用,返回代表具體資料的視圖。觸摸滾動時,頻繁調用。支援成百上千條資料。下面為顯示每條資料的xml檔案:<LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android"android:orientation="horizontal"><ImageView
Time of Update: 2018-12-06
主要的類:android.app :提供高層的程式模型、提供基本的運行環境android.content 包含各種的對裝置上的資料進行訪問和發布的類android.database :通過內容提供者瀏覽和操作資料庫android.graphics :底層的圖形庫,包含畫布,顏色過濾,點,矩形,可以將他們直接繪製到螢幕上.android.location :定位和相關服務的類android.media :提供一些類管理多種音頻、視頻的媒體介面android.net
Time of Update: 2018-12-06
Activities提供了一種方便管理的建立、儲存、回複的對話方塊機制,例如 onCreateDialog(int), onPrepareDialog(int, Dialog), showDialog(int),
Time of Update: 2018-12-06
// 介面載入後彈出軟鍵盤 --- 不能彈出軟鍵盤的主要原因是Android程式未將螢幕繪製完成,所以延遲一定時間,彈出軟鍵盤。Timer timer = new Timer();timer.schedule(new TimerTask(){ @Override public void run() { App.imm.toggleSoftInput(0, InputMethodManager.HIDE_NOT_ALWAYS); }},
Time of Update: 2018-12-06
屬性:android:textAppearance
Time of Update: 2018-12-06
1、Video對於視頻,取第一幀作為縮圖,也就是怎樣從filePath得到一個Bitmap對象。 private Bitmap createVideoThumbnail(String filePath) { Bitmap bitmap = null; MediaMetadataRetriever retriever = new MediaMetadataRetriever();try {
Time of Update: 2018-12-06
public class VideoActivity extends Activity {private static final String TAG = "VideoActivity";private EditText filenameText;private SurfaceView surfaceView;private MediaPlayer mediaPlayer;@Overridepublic void onCreate(Bundle savedInstanceState)
Time of Update: 2018-12-06
一、android有四種預設的Dialog實現:AlertDialog、ProgressDialog、DatePickerDialog、TimePickerDialog。另外你還可以繼承android.app.Dialog實現自已的dialog。 二、AlertDialog是一種能構造預設的一、二、三個按鈕的對話方塊和單選或多選的的選擇對話方塊。 三、ProgressDialog是繼函大自AlertDialog,除了AlertDialog功能外,它還能顯視進度圈或條的對話方塊。 四、Da
Time of Update: 2018-12-06
查詢了google發現在android一下有幾種方法可以做到,但是經過實際測試發現下面這種方法是最準確的Rect bounds = new Rect();String text = "Hello World";TextPaint paint;paint = findViewById(R.id.hello_world).getPaint();paint.getTextBounds(text, 0, text.length(), bounds);int width = bounds.width();
Time of Update: 2018-12-06
TableLayout經常用的屬性是: 1.android:collapseColumns:以第0行為序,隱藏指定的列:把android:collapseColumns=0,2 意思是把第0和第2列隱藏
Time of Update: 2018-12-06
最近項目中用用到語言切換功能,第一想到的就是資源檔,沒錯。 在資源檔中建立一個檔案夾values-en,在裡面建立一個strings.xml,把預設values檔案夾中的strings.xml中的內容Copy至values-en中的strings.xml,再把該檔案夾中的中文內容轉換為英文,例如<string name="set">設定</string>轉換為<string name="set">set</string>
Time of Update: 2018-12-06
android在處理一寫圖片資源的時候,會進行一些類型的轉換,現在有空整理一下: 1、Drawable → BitmapJava代碼 public static Bitmap drawableToBitmap(Drawable drawable) { Bitmap bitmap = Bitmap .createBitmap( d
Time of Update: 2018-12-06
為輸入文字框或其他視圖建立一個IME,需要繼承InputMethodService類。InputMethodService提供了很多的IME的基礎實現,管理狀態的條款、IME的可見度、與當前可見的Activity溝通. 一個好的出發點是SDK裡提供的SoftKeyboard範例,也可以修改範例代碼去建立你自己的IME。 IME像應用和服務一樣被打包。在AndroidManifest.xml檔案中,把IME作為一個服務(Service)來聲明,附帶一些適當的intent過濾器和一些相關的中繼資料: