[안드로이드,Android] 안드로이드 TOAST 띄우기

2012. 12. 28. 13:46Mobile/Android



반응형

안드로이드 Toast

 

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();

반응형