![](/img/trans.png)
[英]In the Gallery from Intent.ACTION_PICK, can I override the longClick?
[英]How can i dismiss the dialog created from Intent.Action Pick to get Gallery images?
我正在使用一個Intent獲取Gallery Images,這將導致一個對話框來選擇一個選項。 我正在使用這個意圖
Intent photoPickerIntent = new Intent(
Intent.ACTION_PICK,
android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
startActivityForResult(photoPickerIntent, 123);
但是我希望當我在對話框外觸摸時,該對話框會消失。我也正在使用Fragment
使用此: yournameofdialog.setCanceledOnTouchOutside(true);
但我認為這不是對話,而是一項新活動。 要取消此操作,請使用設備的“后退”按鈕。
希望能幫助到你
使用它可能會有所幫助
Dialogname.setCanceledOnTouchOutside(true);
或這個
public boolean onTouchEvent(MotionEvent event)
{
if(event.getAction() == MotionEvent.ACTION_OUTSIDE){
System.out.println("TOuch outside the dialog ******************** ");
this.dismiss();
}
return false;
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.