안드로이드 TOAST창 띄우기 예제입니다.


EX.1)
Toast toast = Toast.makeText(getApplicationContext(),
   "토스트창에 출력될 문자", Toast.LENGTH_LONG);
toast.setGravity(Gravity.CENTER, 0, 0);
toast.show();
 
EX.2)
Toast toast = Toast.makeText(getApplicationContext(),
   토스트창에 출력될 문자", Toast.LENGTH_LONG);
toast.setGravity(Gravity.CENTER, 0, 0);
LinearLayout toastView = (LinearLayout) toast.getView();
ImageView imageCodeProject = new ImageView(getApplicationContext());
imageCodeProject.setImageResource(R.drawable.codeprojectlogo);
toastView.addView(imageCodeProject, 0);
toast.show();

Posted by 준콩ol 준콩ol

댓글을 달아 주세요