0
실제로 옵션 메뉴 항목을 클릭하고 내 옵션 메뉴가 화면 하단에있는 경우 (splitActionBarWhenNarrow) 팝업 창이 나타납니다 (사용자 정의 레이아웃). 일부 예외가 발생했습니다. 코드 : 이와 같이안드로이드 옵션 메뉴에서 팝업 창
switch (item.getItemId()) {
case R.id.redid:
Toast.makeText(MainActivity.this,"red color", Toast.LENGTH_SHORT).show();
break;
case R.id.blueid:
Toast.makeText(MainActivity.this,"blue color", Toast.LENGTH_SHORT).show();
break;
case R.id.greenid:
LayoutInflater inflater=(LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View popupview=inflater.inflate(R.layout.popuplayout,null);
PopupWindow popwindow=new PopupWindow(popupview,LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT);
popwindow.showAsDropDown(item.getActionView(), 100, 100);
PopupWindow를 greenid로 표시 하시겠습니까? 적색과 청색의 토스트 메시지를 볼 수 있습니까? –
예 토스트도 잘 작동합니다. – skyshine