android 日付ダイアログ、アプリのエクスポートエラー

DatePickerDialogで日付の選択範囲を指定

DatePickerDialog

   1:          // DatePickerDialog の日付が変更されたときに呼び出されるコールバックを登録  
   2:          DatePickerDialog.OnDateSetListener listener = new DatePickerDialog.OnDateSetListener() {
   3:              public void onDateSet(
   4:                      DatePicker view,
   5:                      int year,
   6:                      int monthOfYear,
   7:                      int dayOfMonth) {
   8:                  mYear = year; // '年' を取得  
   9:                  mMonth = monthOfYear; // '月' を取得  
  10:                  mDay = dayOfMonth; // '日' を取得  
  11:                  
  12:              }
  13:          };
  14:   
  15:          // DatePickerDialog の作成  
  16:          datePickerDialog = new DatePickerDialog(
  17:                  this, // 第1引数 : Context  
  18:                  listener, // 第2引数 : DatePickerDialog.OnDateSetListener  
  19:                  mYear, // 第3引数 : 年  
  20:                  mMonth, // 第4引数 : 月  
  21:                  mDay // 第5引数 : 日  
  22:          );
  23:   
  24:          // Dialog の SETボタンを設定  
  25:          datePickerDialog.setButton(
  26:                  DialogInterface.BUTTON_POSITIVE,
  27:                  "SET",
  28:                  new DialogInterface.OnClickListener() {
  29:                      public void onClick(DialogInterface dialog, int which) {
  30:                          // SET Button がクリックされた時の動作  
  31:                          // 日付ダイアログを閉じる
  32:                          datePickerDialog.hide();
  33:   
  34:                      }
  35:                  }
  36:                  );
  37:   
  38:          // Dialog の CANCELボタンを設定  
  39:          datePickerDialog.setButton(
  40:                  DialogInterface.BUTTON_NEGATIVE,
  41:                  "CANCEL",
  42:                  new DialogInterface.OnClickListener() {
  43:                      public void onClick(DialogInterface dialog, int which) {
  44:                          // CANCEL Button がクリックされた時の動作
  45:   
  46:                          // 日付ダイアログを閉じる
  47:                          datePickerDialog.hide();
  48:                      }
  49:                  }
  50:                  );
  51:          
  52:          datePickerDialog.show();

 

androidで<input>要素のplaceholder属性みたいにしたいとき

android:hint=”@string/hoge” を追加する

<EditText android:id=”@+id/hoge” android:layout_width=”fill_parent” android:layout_height=”wrap_content” android:hint=”@string/hoge” />

 

 

http://www.att42.com/menu/memo/android/xml/inputType.html

 

Android ToolsでアプリをExportしようとするとエラーになるとき

メニューの「ウィンドウ」から「設定」を開き、「Android」-「Lint エラー 検査」を選択

– MissingTranslation

– DuplicateIds

– Instantiatable

で検索してseverityのところを「Warning」へ選考する

参考サイト

 

 

layoutのxmlの要素がまとめたるところ

http://workpiles.com/2014/09/android-lint-errors/