0
這就是我現在所做的。Android:AlertDialog在畫廊前
alertDialog = new AlertDialog.Builder(getApplicationContext())
.setView(layout)
.setPositiveButton(getString(R.string.create), null)
.setNegativeButton(getString(R.string.cancel), null)
.create();
alertDialog.setOnShowListener(new DialogInterface.OnShowListener() {
@Override
public void onShow(DialogInterface dialog) {
Button btnCreate = alertDialog.getButton(AlertDialog.BUTTON_POSITIVE);
btnCreate.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String categoryTitle = etCategoryTitle.getText().toString();
}
});
ImageButton ibAdd = (ImageButton) layout.findViewById(R.id.ibAdd);
ibAdd.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
try {
intent.putExtra("return-data", true);
startActivityForResult(intent, PICK_IMAGE);
} catch(ActivityNotFoundException e) {
}
}
});
}
});
alertDialog.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);
alertDialog.show();
點擊稱爲ibAdd
的ImageButton的情況下,屏幕應該移動到畫廊中選擇一個圖片。在這裏,我設法到達畫廊,但問題是警報對話框仍在畫廊的前面,所以我不能先選擇圖像而不先關閉對話框。
這個問題的任何解決方案?
你能提供截圖嗎? –