0

アクティビティからポップアップ ウィンドウに値を渡すにはどうすればよいですか? ばかげた質問に思えますが。コード スニペットは以下のとおりです。関数 onButtonPopup() からポップアップ ウィンドウ (shape_details.xml) に値を渡すだけです。前もって感謝します。

public void onButtonPopup(View target, int position) {
    // Make a View from our XML file
    LayoutInflater inflater = (LayoutInflater) this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View layout = inflater.inflate(R.layout.shape_details, (ViewGroup) findViewById(R.id.llShapeDetails));

    Display display = getWindowManager().getDefaultDisplay();




    int width = display.getWidth();
    int height = display.getHeight();

    pw = new PopupWindow(layout, width - width / 4, height - height / 3, true);

    pw.setAnimationStyle(R.style.PopupWindowAnimation);
    pw.showAtLocation(layout, Gravity.CENTER, 0, 0);
}
4

1 に答える 1