Time of Update: 2018-12-05
我們先來看中的幾個按鈕。從按鈕上的文字可以看出,一個大按鈕,一個小按鈕,還有一個有點奇怪的按鈕。嗯,先說這麼多。那我們先說中的幾個按鈕是如何?的吧。單純的把按鈕顯示在上面的話可以在main.xml中添加相應組件就OK了。下面我們就來添加吧!<?xml version="1.0" encoding="utf-8"?><ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
Time of Update: 2018-12-05
今天寫個東西,老是崩潰,崩潰。。。。最後發現是因為自己添加了一個activity,但是沒有在Androidmenifest.xml中註冊。。。。。昨天往安智網上傳一個軟體,老是上傳失敗,我就鬱悶了,為啥呢?而且所給的提示是該軟體已被認領,我想我早上剛剛寫好的軟體怎麼這麼快就被認領了,不可能這麼巧吧?後來我糾結了好長時間,發現是因為我的apk包名跟前一個軟體的包名相同。所以導致了錯誤。真是一個悲劇。。。。。。大家以後注意吧
Time of Update: 2018-12-05
1. 源起 很多分頁載入的組件都是繼承自ScrollView,分頁要檢查是否滾動到底部,下拉重新整理需要檢測是否滾動到頂部。2. 代碼<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
Time of Update: 2018-12-05
這個雖然估計以後不會怎麼用得到,但還是覺得應該存起來轉自http://blog.csdn.net/jasonzhou613/article/details/9194597簡繁體相互轉換,首先我們要引入一個包:jcc-bate-0.7.3.jar。我們先來看下這個包的結構:由圖我們知道,通過JChineseConvertor.getInstance();可以得到執行個體,再通過s2t和t2s方法可以進行轉化。s2t方法就是將簡體轉換成繁體,t2s方法就是將繁體轉換成簡體。[java] view
Time of Update: 2018-12-05
Android 記憶體分析工具 MAT(Memory Analyzer Tool)(轉)2011-08-10 10:23如果使用DDMS確實發現了我們的程式中存在記憶體流失,那又如何定位到具體出現問題的程式碼片段,最終找到問題所在呢?如果從頭到尾的分析代碼邏輯,那肯定會把人逼瘋,特別是在維護別人寫的代碼的時候。這裡介紹一個極好的記憶體分析工具 -- Memory Analyzer Tool(MAT)。
Time of Update: 2018-12-05
對圖片本身進行操作。盡量不要使用setImageBitmap、setImageResource、BitmapFactory.decodeResource來設定一張大圖,因為這些方法在完成decode後,最終都是通過java層的createBitmap來完成的,需要消耗更多記憶體。因此,改用先通過BitmapFactory.decodeStream方法,建立出一個bitmap,再將其設為ImageView的source,decodeStream最大的秘密在於其直接調用JNI>>nati
Time of Update: 2018-12-05
Java中的SoftReference即對象的軟引用。如果一個對象具有軟引用,記憶體空間足夠,記憶體回收行程就不會回收它;如果記憶體空間不足了,就會回收這些對象的記憶體。只要記憶體回收行程沒有回收它,該對象就可以被程式使用。軟引用可用來實現記憶體敏感的快取。使用軟引用能防止記憶體泄露,增強程式的健壯性。 SoftReference的特點是它的一個執行個體儲存對一個Java對象的軟引用,該軟引用的存在不妨礙垃圾收集線程對該Java對象的回收。也就是說,一旦SoftReference儲存了對一個
Time of Update: 2018-12-05
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="wrap_content" android:layout_height="wrap_content" >
Time of Update: 2018-12-05
SharedPreferences是Android平台上一個輕量級的儲存類,主要是儲存一些常用的配置比如視窗狀態,一般在Activity中 重載視窗狀態onSaveInstanceState儲存一般使用SharedPreferences完成,它提供了Android平台常規的Long長 整形、Int整形、String字串型的儲存,它是什麼樣的處理方式呢?SharedPreferences類似過去Windows系統上的ini設定檔,但是它分為多種許可權,可以全域共用訪問,android123提示最
Time of Update: 2018-12-05
//main.xml如下:<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" >
Time of Update: 2018-12-05
mainActivity如下:package c.c;import android.app.Activity;import android.os.Bundle;import android.widget.SlidingDrawer;import android.widget.SlidingDrawer.OnDrawerCloseListener;import android.widget.SlidingDrawer.OnDrawerOpenListener;import
Time of Update: 2018-12-05
main.xml如下:<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" > <ListView
Time of Update: 2018-12-05
mainActivity如下:package cn.c;import java.io.File;import java.util.ArrayList;import java.util.Set;import android.app.Activity;import android.gesture.Gesture;import android.gesture.GestureLibraries;import android.gesture.GestureLibrary;import
Time of Update: 2018-12-05
mainActivity如下:package c.c;import android.app.Activity;import android.content.ContentValues;import android.content.Intent;import android.net.Uri;import android.os.Bundle;import android.provider.MediaStore;import android.view.View;import android.view.
Time of Update: 2018-12-05
public static String getDataByPost(String APIUrl,Map<String, String> paramsHashMap){String result=null;try {HttpPost httpPost = new HttpPost(APIUrl);DefaultHttpClient httpClient = getHttpClient();List<BasicNameValuePair> postData = new
Time of Update: 2018-12-05
MainActivity如下:package cn.testhomekey;import android.os.Bundle;import android.app.Activity;import android.content.Intent;import android.content.IntentFilter;/** * Demo描述: * 利用廣播監聽裝置的HOME和RECENT_APPS鍵被按下 * * 參考資料: *
Time of Update: 2018-12-05
最近由於項目中要用到一個效果,就是TextView傾斜的顯示效果,研究了一下,發現很簡單,特分享出來,供需要用到的親們使用,有圖他媽的就是有真相,先,每個item的右上方可以顯示一個斜角的TextView,接下來上碼,接招!先自訂一個TextViewpublic class JZADScoreTextView extends TextView{ public JZADScoreTextView(Context context) { super(context);
Time of Update: 2018-12-05
學習Android已經快一年了,前半年一直滿足與寫個TextView,然後讓它顯示在案頭,或者寫個ImageView,然後設定一片,讓它顯示一下。樂此不疲的,自我沉浸於那樣的滿足之中!前端時間在網上接了寫項目做,才發現自己實在是太無知了!連簡單的類比發送表單也不會,傳送帶參數的檔案也不會,如何非同步更新View也不會。在跌跌撞撞中交了第一個項目。那是一個簡單的項目,收集一些資料,然後整理成xml檔案,上傳到指定的網站。
Time of Update: 2018-12-05
一、緣起 最近需要使用Google OAuth和Google Map,在使用Google的這些服務之前,有一些相同的準備工作要做。 這些工作包括:安裝Google Play Services,產生認證指紋,建立Client ID 二、安裝Google Play Services Google Map的API被整合在Google Play Services包中了,這個包可以使用Android Sdk Manager下載,位置:Extras->Google Play
Time of Update: 2018-12-05
建一個Android工程tabHost,包名com.test.wwwman的布局檔案,加了一些無關的TextView,可把這些TextView去掉<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent"