2.onCreateメソッド

Android開発に関するメモランダム

カテゴリー: 日記アプリ  閲覧数:423 配信日:2013-10-03 10:45


2-1.レイアウトファイルを指定


レイアウトファイル指定
setContentView(R.layout.top);

・これ以降のコード内容を、「▼/res/layout/top.xml」へセット


2-2.リソースを割り当て


変数にコンテキスト上にあるリソースを割り当てる
    	/* どのItemを操作するのかリソースを割り当て */
       tv_last = (TextView)findViewById(R.id.TextView_last_month);//先月
       tv_date = (TextView)findViewById(R.id.TextView_date);//2013/9
       tv_next = (TextView)findViewById(R.id.TextView_next_month);//翌月
       et_search = (EditText)findViewById(R.id.EditText_top_search);//編集
       btn_top_search = (Button)findViewById(R.id.Button_top_search);//検索
       btn_top_add = (Button)findViewById(R.id.Button_top_add);//今日の日記を書く
       all = (LinearLayout)findViewById(R.id.LinearLayout_all);//画面全体LinearLayout
listView = (ListView)findViewById( R.id.ListView_searchlist );//フッター検索部分リストビュー



週間人気ページランキング / 2-16 → 2-22
順位 ページタイトル抜粋 アクセス数
アクセスが、ありませんでした! 0
2025/2/23 1:01 更新
指定期間人気ページランキング / 1970-1-1 → 2025-2-22
順位 ページタイトル抜粋 アクセス数
アクセスが、ありませんでした! 0
2025/2/23 1:01 更新