카테고리 없음

버튼 누르면 메시지 나오게 하기,

물고기탐정 2019. 6. 12. 00:22

버튼 누르면 메시지 나오게 하기와 버튼 누르면 웹브라우저 나오게 하기 명령어

 

 

//버튼 눌렀을때 메시지 보이기
public void onButton1Clicked(View v) {
Toast.makeText(getApplicationContext(),"버튼이눌렸어요",Toast.LENGTH_LONG).show();

}

//버튼 눌렀을때 웹브라우저 보이게 하기
public void onButton2Clicked(View v){
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://m.daum.net "));
startActivity(intent);

}

 

설명

Toast는 잠깐 메시지를 나오게 한다.

Intetn는 웹브라우져를 나오게 한다.