原创 io(輸入輸出流)

字節流:InputStream、OutputStream 字符流:Reader、Writer InputStream子類:ByteArrayInputStream、FileInputStream、FilterInputStream(

原创 觀察者模式(Observer)

核心思想 又被成爲發佈---訂閱模式。 定義對象間的一種一對多的依賴關係,讓多個觀察者對象同時關注一個對象,當該對象的狀態發生改變時,所有依賴於它的對象都得到通知並被自動更新。 (https://wenda.so.com/q/

原创 SQLIte中刪除數據庫

package com.example.administrator.madioplayer2; import android.content.Context; import android.database.sqlite.SQLiteD

原创 ListView的長按事件和item點擊時間衝突

把return false修改爲true就可以了private ListView.OnItemLongClickListener listItemLongLis=new ListView.OnItemLongClickListener()

原创 ArrayAdapter requires the resource ID to be a TextView

在ArrayAdapter()這個類中有多個構造方法,我僅據此列以作代表: ArrayAdapter(Context context ,int textViewResourceId ,List<T> objects)   參數:

原创 刪除SD卡的視頻以及MediaStore的數據庫的信息

刪除SD的視頻:private void delateSdVideo(String path){ Log.d("TAG","開始刪除SD中的視頻"); File file = new File(path); fil

原创 E/CursorWindow: Failed to read row 0, column -1 from a CursorWindow which has 4 rows, 2 columns.

在一個界面中顯示兩個ListView的時候,另一個ListView怎麼都顯示不出來,獲取cusor的個數的時候,明明顯示爲4。據網上說是cusor的問題,實在是不懂怎麼修改,就把數據庫刪除了,重新建一個,然後插入數據,結果真的可以。估計是

原创 利用rawQuery(String sql, String[] selectionArgs)查詢表中的的數據

開始寫的代碼是這樣子的:private void findData(){ sqLiteDatabase=dbHelper.getWritableDatabase(); Cursor cursor = sqLiteDatab

原创 關於利用adb查看文件

cd SDK\platform-tools adb shell 使用ls命令列出當前目錄下所有的包名 root@android:/data/data # pm list package 列出當前目錄下的文件及文件夾 root@andro

原创 E470C觸摸屏的關閉

控制版面->鼠標->Windows設置“精確式觸摸板”->連接鼠標時讓觸屏保持打開狀態(把√去掉)

原创 Intel HAXM is required to run this AVD VT-x is disabled in BIOS 問題

電腦是ThinkPad e470c 重啓  按enter鍵進入BOIS 然後再找到Intel Virtualization Technology 把Disable修改成Enable就可以了

原创 andriod studio去除標題欄顯示的題目

第一種、setTitle: ActionBar actionBar = this.getSupportActionBar(); actionBar.setTitle(""); 第二種、設置label=“”: <activity andro

原创 java.lang.IllegalStateException: trying to requery an already closed cursor android.database.sqlite

搜索的界面使用的數據時從SQLite中獲取的,每次使用cursor之後都添加startManagingCursor(data);來處理cursor的關閉問題。出現的問題是:當從當前頁面跳轉到下一個頁面的時候,會關閉當前頁面,回到再前一個頁

原创 同一個界面中添加顯示兩個ListView

參考網址:(https://www.cnblogs.com/naishan/p/5650470.html)(http://blog.csdn.net/newfar1991/article/details/8087220)因爲使用Simpl

原创 cannot resolve symbol/connot resolve symbol “R"

cannot resolve symbol: 在給strings.xml寫入字符串時是這樣子寫的: android:text="" 在andriod studio自動顯示出來的選項中選擇@string/app-name,然後再將app-