原创 將map和泛型爲map的list集合插入到指定的數據庫表中

將HashMap static SQLiteDatabase db; public int insertSQL(String table, HashMap<String, String> map) { long

原创 android 改變輸入法enter鍵文字 爲搜索 下一個 以及前往

我們大家都知道通過指定EditText的android:imeOptions屬性可以修改 輸入法enter鍵的顯示情況 例如: android:imeOptions=”actionNext” 下一個配合android:nextFo

原创 TextView實現跑馬燈的效果;

用textview實現跑馬燈的效果; <com.example.dialoge.MyTextView android:id="@+id/textView1" android:layout_width="

原创 notifyDataSetChanged()刷新數據不更新原因

使用Listview的時候: 當要動態顯示更改後的數據(例如數據庫改動), 很多人應該都用過notifyDataSetChanged();這個方法來刷新Listview,顯示改後的數據. 引用網上的一片文章: 這時候就要注意了:

原创 AutoCompleteTextView針對SimpleAdapter 源碼改動的適配器

主要功能是提示的內容不是以輸入的內容開頭的,因爲AutoCompleteTextView基本用法都是輸入什麼就提示以輸入內容開頭的內容。 package com.example.xujiingqing; import java.

原创 服務端程序鏈接oracle數據庫

首先創建一個數據庫鏈接類:GetCon package com.db; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLExce

原创 將一個輸入流打印到控制檯

public static void print (InputStream is) throws UnsupportedEncodingException{ InputStreamReader isr =new Input

原创 程序全屏去掉上邊的ActionBar,和狀態欄

其實去掉Actionbar非常簡單,我之前也寫過有三種方法: 這裏只說一種比較簡單的方法, 直接在onCreate方法中添加這句就能實現去掉ActionBar, 注意的是必須要在setContentView方法之前調用;

原创 AutoCompleteTextView 設置了點擊事件需要點擊兩下解決辦法

今天用AutoCompleteTextView 設置了點擊事件爲了使其彈出提示內容,但是發現需要點擊兩下才會觸發OnClick事件。 在網上找到了一個辦法是換成OnTouch方法, 在Android中,onClick、onLongCl

原创 訪問服務器請求數據

佈局文件: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.androi

原创 ListView顯示當前選取的item

設置當前item爲選中的狀態; mMenuListView.setItemChecked(position, true); 設置listview顯示當前選中的item; mMenuListView.setSelection(p

原创 是否減少活動主窗口大小以便騰出空間放軟鍵盤

android:windowSoftInputMode="stateAlwaysHidden|adjustPan" <activity android:name="com.minimaxhk.nu

原创 給按鈕點擊事件添加音效;

編寫佈局文件只添加一個button; <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://sch

原创 調用手機的震動器

手機的振動器需要添加權限; <uses-permission android:name="android.permission.VIBRATE" /> Vibrator vibrator =(Vibrator) getSyste

原创 oracle數據庫表空間不足解決辦法;

查詢表的空間; select tablespace_name, file_id, file_name, round(bytes/(1024*1024),0) total_space from dba_data_files order