【发布时间】:2025-12-30 03:15:12
【问题描述】:
我想在单击一个按钮(参见下文)后添加一个 AlertDialog,该按钮启动一个活动以选择图片。
我点击按钮选择一张图片。我选择了图片,我想在选择图片后显示我的 AlertDialog。
final Button myButton = (Button) findViewById(R.id.button);
myButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(MyActivity.this, OpenImageActivity.class);
startActivity(intent);
}
});
如何使我的 AlertDialog 可见?
谢谢。
【问题讨论】:
-
还有什么问题?
-
如何让我的 AlertDialog 可见?
标签: android button android-intent android-alertdialog