原创 startActivityForResult用法

startActivityForResult與startActivity的不同之處在於:· startActivity( ):僅僅是跳轉到目標頁面,若是想跳回當前頁面,則必須再次調用startActivity( )。· startActiv

原创 android:layout_gravity 和 android:gravity 的區別

android:gravity 是對元素本身來說的,元素本身的內容顯示在什麼地方由它設定,默認是在左側。android:layout_gravity 是相對於它的父元素來說的,決定此元素顯示在父元素的什麼位置

原创 我的友情鏈接

51CTO博客開發

原创 睡眠排序法(java)

我們學數據結構的時候會學到過多種排序算法,基本上都是基於比較的排序,下面這一排序算法的思想會讓你大吃一驚:public class SleepSort { public static void main(String[] args)

原创 github的使用(git shell )

一、登錄到git,新建一個版本倉庫二、在“Repository name”一欄裏填寫版本倉庫的名稱,如”test”,Description欄是描述,可填可不填。默認訪問權限爲公共,點擊”Creating Repository”按鈕,即創建了

原创 我的友情鏈接

51CTO博客開發

原创 The connection to adb is down, and a severe error has occured.

    今天在eclipse中調試時,報The connection to adb is down, and a severe error has occured.的錯誤。在網上查了下,網友說在任務管理器上把adb.exe關閉掉,重啓ecl

原创 startActivityForResult用法

startActivityForResult與startActivity的不同之處在於:· startActivity( ):僅僅是跳轉到目標頁面,若是想跳回當前頁面,則必須再次調用startActivity( )。· startActiv

原创 得到文件夾下所有的文件

得到文件下所有的mp3文件,循環遍歷所有子文件  //得到所有的mp3文件  List<File> list = new ArrayList<File>();  public void getMusicFile(File file){

原创 使用github時因fatal: remote origin already exists錯誤,無法提交

如果輸入$ git remote add origin [email protected]:XXX(github帳號名)/xxx(項目名).git提示出錯信息:fatal: remote origin already exists.解決辦法如下:

原创 android:layout_gravity 和 android:gravity 的區別

android:gravity 是對元素本身來說的,元素本身的內容顯示在什麼地方由它設定,默認是在左側。android:layout_gravity 是相對於它的父元素來說的,決定此元素顯示在父元素的什麼位置

原创 插入排序

直接插入排序 在要排序的一組數中,假設前面(n-1)[n>=2] 個數已經是排好順序的,現在要把第n個數插到前面的有序數中,使得這n個數也是排好順序的。 代碼實現:public class InsertSort {    public 

原创 java.lang.ClassCastException: android.app.Application cannot be cast to ***

出現這個的錯誤原因是在manifest.xml文件中沒有加標記的那行<application        android:name="com.example.MyApplication"        android:allowBacku

原创 FileInputStream和FileOutputStream實現文件的讀寫操作

public class IOtest { public void test(){ //read File fi = new File("images"+File.separator+"1.jpg"); byte[] str

原创 利用半透明對話框實現android運行時的提示界面

首先,設置要覆蓋在最上方的dialog的view<?xml version="1.0" encoding="utf-8"?> <RelativeLayout android:background="@drawable/navigater_b