讓android應用程式跳轉到系統的各個設定頁面

在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

Android開發中常用到Intent的URI與樣本

下面是常用到的Intent的URI及其樣本,包含了大部分應用中用到的共用Intent。一、開啟一個網頁,類別是Intent.ACTION_VIEW  Uri uri = Uri.parse("http://blog.3gstdy.com/");  Intent intent = new Intent(Intent.ACTION_VIEW, uri);二、開啟地圖並定位到一個點  Uri uri = Uri.parse("geo:52.76,-79.0342″);  Intent intent =

android 監聽SDCard安裝和卸載的程式碼片段(測試通過)

// 監聽類private final BroadcastReceiver sdcardListener = new BroadcastReceiver() { @Overridepublic void onReceive(Context context, Intent intent) { String action = intent.getAction(); Log.d("TAG", "sdcard action:::::" +

Android添加頂部通知(Notification)並處於“進行中中”(onGoing)

用過Android版的QQ的都知道,QQ返回的時候在頂部通知裡會出現一個企鵝,表明QQ正在運行,可以拉開通知,點擊手機QQ出現主介面,繼續運行。所以我想讓自己的軟體也出現這麼一個通知,並且可以快速的開啟查看。Android應用開發詳解 8.3 Notification和NotificationManager的使用 P178 /*** 添加頂部通知* @author liuzhao*/public void

Android RingtoneManager鈴聲管理

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

提高android應用的效率–主要講解listview的最佳化

Adapter是listview和資料來源間的中間人。當每條資料進入可見地區時,adapter的getview()會被調用,返回代表具體資料的視圖。觸摸滾動時,頻繁調用。支援成百上千條資料。下面為顯示每條資料的xml檔案:<LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android"android:orientation="horizontal"><ImageView

Android架構圖以及主要類

主要的類:android.app :提供高層的程式模型、提供基本的運行環境android.content 包含各種的對裝置上的資料進行訪問和發布的類android.database :通過內容提供者瀏覽和操作資料庫android.graphics :底層的圖形庫,包含畫布,顏色過濾,點,矩形,可以將他們直接繪製到螢幕上.android.location :定位和相關服務的類android.media :提供一些類管理多種音頻、視頻的媒體介面android.net

Android對話方塊-中篇-之建立自己的對話方塊

  Activities提供了一種方便管理的建立、儲存、回複的對話方塊機制,例如 onCreateDialog(int), onPrepareDialog(int, Dialog), showDialog(int),

Android 如何讓EditText不自動擷取焦點

在項目中,一進入一個頁面, EditText預設就會自動擷取焦點。那麼如何取消這個預設行為呢? 在網上找了好久,有點 監聽軟鍵盤事件,有點 調用 clearFouse()方法,但是測試了都沒有! xml中也找不到相應的屬性可以關閉這個預設行為 解決之道:在EditText的父級控制項中找一個,設定成   android:focusable="true"    

android手動調用震動器(Vibrator)

Vibrator vv=(Vibrator) getApplication().getSystemService(Service.VIBRATOR_SERVICE);vv.vibrate(500);//震半秒鐘vv.vibrate(new long[]{10, 100, 20, 200}, -1);關 於vv.vibrate(new long[]{10, 100, 20, 200}, -1); 參數1:表示停10ms, 震100ms, 停20ms,震200ms參數2:-1

android彈出軟鍵盤

// 介面載入後彈出軟鍵盤 --- 不能彈出軟鍵盤的主要原因是Android程式未將螢幕繪製完成,所以延遲一定時間,彈出軟鍵盤。Timer timer = new Timer();timer.schedule(new TimerTask(){ @Override public void run() { App.imm.toggleSoftInput(0, InputMethodManager.HIDE_NOT_ALWAYS); }},

Android之系統內建的文字外觀設定

屬性:android:textAppearance   

Android 監聽home鍵(android:launchMode=”singleTask” 與 onNewIntent(Intent intent) 的用法

android:launchMode="singleTask" 和 onNewIntent(Intent intent)兩個特性,現總結一下經驗:android:launchMode="singleTask" 配置在 Mainifest 中,它保證了棧中此Activity總是只有一個,無論你啟動它多少次;onNewIntent(Intent intent) 是Override

android為視頻、音樂、圖片等產生縮圖

1、Video對於視頻,取第一幀作為縮圖,也就是怎樣從filePath得到一個Bitmap對象。 private Bitmap createVideoThumbnail(String filePath) { Bitmap bitmap = null; MediaMetadataRetriever retriever = new MediaMetadataRetriever();try {

android 編寫簡易視頻播放器

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)

Android對話方塊-上篇-之系統對話方塊

 一、android有四種預設的Dialog實現:AlertDialog、ProgressDialog、DatePickerDialog、TimePickerDialog。另外你還可以繼承android.app.Dialog實現自已的dialog。  二、AlertDialog是一種能構造預設的一、二、三個按鈕的對話方塊和單選或多選的的選擇對話方塊。  三、ProgressDialog是繼函大自AlertDialog,除了AlertDialog功能外,它還能顯視進度圈或條的對話方塊。  四、Da

Android TableLayout 常用的屬性介紹及示範

TableLayout經常用的屬性是:   1.android:collapseColumns:以第0行為序,隱藏指定的列:把android:collapseColumns=0,2 意思是把第0和第2列隱藏   

Android編程擷取手機型號,本機電話號碼,sdk版本及firmware版本號碼(即系統版本號碼)

Android開發平台中,可通過TelephonyManager 擷取本機資訊。TelephonyManager phoneMgr=(TelephonyManager)this.getSystemService(Context.TELEPHONY_SERVICE);  txtPhoneModel.setText(Build.MODEL); //手機型號  txtPhoneNumber.setText(phoneMgr.getLine1Number());//本機電話號碼 

Android開發人員必須深入學習的10個應用開源項目

Android開發又將帶來新一輪熱潮,很多開發人員都投入到這個浪潮中去了,創造了許許多多相當優秀的應用。其中也有許許多多的開發人員提供了應用開源項目,貢獻出他們的智慧和創造力。學習開原始碼是掌握技術的一個最佳方式。下面推薦幾個應用開源項目,這些項目不僅提供了優秀的創意,也可以直接掌握Android核心的介面使用:1、Android團隊提供的樣本項目   如果不是從學習Android

Android廣播機制(兩種註冊方法)與 中斷廣播

  兩種註冊類型的區別是:     1)第一種不是常駐型廣播,也就是說廣播跟隨activity的生命週期。注意: 在activity結束前,移除廣播接收器。    

總頁數: 2771 1 .... 992 993 994 995 996 .... 2771 Go to: 前往

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.