日付選択ダイアログ
final Calendar calendar = Calendar.getInstance(); final int year = calendar.get(Calendar.YEAR); final int month = calendar.get(Calendar.MONTH); final int day = calendar.get(Calendar.DAY_OF_MONTH); final DatePickerDialog datePickerDialog = new DatePickerDialog( this, new DatePickerDialog.OnDateSetListener() { @Override public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) { Log.v("", String.valueOf(year) + "/" + String.valueOf(monthOfYear + 1) + "/" + String.valueOf(dayOfMonth)); } }, year, month, day); datePickerDialog.show(); }
PackageManager packageManager = getPackageManager(); Drawable icon = null; try { icon = packageManager.getApplicationIcon("[パッケージ名]"); } catch (NameNotFoundException e) { e.printStackTrace(); }