亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

為什么要設置informationact=1?這句話是什么意思?

為什么要設置informationact=1?這句話是什么意思?

肖小波 2016-07-04 18:49:25
private SQLiteDatabase m_dbSQLiteDatabase=null;?? ?private TextView m_textview1=null;?? ?private static final int INFORMATIONACT=1;?? ?@Override?? ?protected void onCreate(Bundle savedInstanceState) {?? ??? ?super.onCreate(savedInstanceState);?? ??? ?setContentView(R.layout.activity_main);?? ??? ?Intent intent = new Intent(MainActivity.this,yypService.class); ??? ??? ?startService(intent); ??? ??? ?m_textview1=(TextView)findViewById(R.id.textview1);?? ??? ?//創建或打開數據庫?? ??? ?Button button1=(Button)findViewById(R.id.button1);?? ??? ?button1.setOnClickListener(new OnClickListener(){?? ??? ??? ?public void onClick(View v){?? ??? ??? ??? ?m_dbSQLiteDatabase=OpenOrCreateDB();?? ??? ??? ??? ?if(m_dbSQLiteDatabase==null)?? ??? ??? ??? ??? ?m_textview1.setText("數據庫打開失?。?);?? ??? ??? ??? ?else?? ??? ??? ??? ??? ?m_textview1.setText("數據庫打開成功!");?? ??? ??? ?}?? ??? ??? ?private SQLiteDatabase OpenOrCreateDB() {?? ??? ??? ??? ?SQLiteDatabase dbSQLiteDatabase=null;?? ??? ??? ??? ?try{?? ??? ??? ??? ??? ?dbSQLiteDatabase=SQLiteDatabase.openOrCreateDatabase("/data/data/com.example.demo_01/xiao.db",null);?? ??? ??? ??? ??? ?//以讀寫方式打開數據庫?? ??? ??? ??? ?}?? ??? ??? ??? ?catch(Exception ex){?? ??? ??? ??? ??? ?return null;?? ??? ??? ??? ?}?? ??? ??? ??? ?return dbSQLiteDatabase;?? ??? ??? ??? ??? ??? ?}?? ??? ?});
查看完整描述

1 回答

已采納
?
yanrun

TA貢獻317條經驗 獲得超240個贊

這是設置了一個常量為了增加程序的可讀性,這么做以后維護的人會理解起來更容易。

查看完整回答
1 反對 回復 2016-07-04
  • 1 回答
  • 0 關注
  • 1444 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號