หน้าเว็บ

วันศุกร์ที่ 24 สิงหาคม พ.ศ. 2555

ปรับตำแหน่ง DialogBox


public void run() {
    AlertDialog.Builder builder = new AlertDialog.Builder(activity);
    builder.setMessage(R.string.please_wait).setTitle(null);
   
    AlertDialog dialog = builder.create();
        dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
        WindowManager.LayoutParams WMLP = dialog.getWindow().getAttributes();

    WMLP.x = 100;   //x position
    WMLP.y = 100;   //y position

    dialog.getWindow().setAttributes(WMLP);
    dialog.show();

ไม่มีความคิดเห็น:

แสดงความคิดเห็น