跳至主要内容

android sqlite

        SQLiteDatabase db = SQLiteDatabase.openOrCreateDatabase(MainActivity.this.getString(R.string.db_chat_history), null);
        db.execSQL("create table if not exists unreaded(FromWho text,Msg text)");
        Cursor cursor = db.rawQuery("select * from unreaded", null);
        if(cursor.moveToFirst() && cursor.getCount() >= 1) {
            do {
                sendMsg(cursor.getString(cursor.getColumnIndex("FromWho")),cursor.getString(cursor.getColumnIndex("Msg")));
            } while (cursor.moveToNext());
        }

评论

此博客中的热门博文

android hide actionbar

public class MainActivity extends Activity { ActionBar actionBar; //声明ActionBar @Override protected void onCreate( Bundle savedInstanceState) { super .onCreate(savedInstanceState); setContentView( R .layout.activity_main); actionBar = getSupportActionBar(); //得 到ActionBar actionBar.hide(); //隐藏ActionBar } }

go url encoding

func  QueryUnescape func QueryUnescape (s string ) ( string , error ) QueryUnescape does the inverse transformation of QueryEscape, converting %AB into the byte 0xAB and '+' into ' ' (space). It returns an error if any % is not followed by two hexadecimal digits. func  QueryUnescape func QueryUnescape (s string ) ( string , error ) QueryUnescape does the inverse transformation of QueryEscape, converting %AB into the byte 0xAB and '+' into ' ' (space). It returns an error if any % is not followed by two hexadecimal digits.