resource -> strings.xml ์์ ์์ฑํด์ค๋ค. (alert-Dialog๋ ํ์ ์ฐฝ์ด๋ค.)
MainActivity.java์์ ์ด ๋ถ๋ถ์ ๋ฃ์ด์ค๋ค.
private void showDialog(){
AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
builder.setTitle(R.string.alert_title);
builder.setItems(R.array.alert_photo, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
if(i == 0){
// ์ฒซ๋ฒ์งธ ํญ๋ชฉ ๋๋ ์๋
// ์นด๋ฉ๋ผ๋ก ์ฌ์ง์ฐ๊ธฐ
camera();
}else if(i == 1){
// ๋๋ฒ์งธ ํญ๋ชฉ ๋๋ ์๋
album();
}
}
});
builder.show();
}