Wednesday, November 16, 2011

custom PopupWindow android

private void showAddTextPopup()
{ PopupWindow window1 = new PopupWindow(this);
 window1.setWidth(500);
 window1.setHeight(300);
 window1.setTouchable(true);
 window1.setFocusable(true);
 LayoutInflater inflater = (LayoutInflater) NotesActivity.this .getLayoutInflater();// .getSystemService // (Context.LAYOUT_INFLATER_SERVICE);
 View bottomView = inflater.inflate(R.layout.addtext, null);
 window1.setContentView(bottomView);
 window1.showAtLocation(bottomView, Gravity.CENTER_VERTICAL, 50, 50); }

3 comments:

  1. what does the R.layout.addtext look like in this situation?

    ReplyDelete
    Replies
    1. R.layout.addText is your own custom layout which you want to show in popup.

      Delete
  2. R.layout.addText is your own custom layout which you want to show in popup.

    ReplyDelete

content -->