개발도구/aOS - 안드로이드 개발
[안드로이드] AlertDialog , 스트림 실행하기
Hay's App
2011. 9. 20. 15:07
AlertDialog.Builder builder = new AlertDialog.Builder(this);
// AlertDialog.Builder builder = new AlertDialog.Builder(v.getContext());
builder.setMessage("3G 상태에선 가입하신 요금제에 따라 데이터 통화료가 발생할 수 있습니다.\r\n이점 유의해 주세요.")
.setCancelable(false)
.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
//Toast.makeText(getApplicationContext(), "ID value is " + Integer.toString(id), Toast.LENGTH_SHORT).show();
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("스트림 주소 넣기"));
intent.addCategory(Intent.CATEGORY_BROWSABLE);
intent.putExtra(Browser.EXTRA_APPLICATION_ID, getPackageName());
startActivity(intent);
}
})
.setNegativeButton("No", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
// Toast.makeText(getApplicationContext(), "ID value is " + Integer.toString(id), Toast.LENGTH_SHORT).show();
dialog.cancel();
finish();
}
});
AlertDialog alert = builder.create();
alert.show();