Android-activity-dialog Theme Touch Outsize

Source: Internet
Author: User

Recently encountered a problem with egg ache:

An activity with the theme set to Dialog then click outside to request that activity cannot be closed.

Well, just add a property to the style theme.

Plus to find to be more than 11 version to support, alas, egg pain, now who is also compatible with 15 below, this saying good, is right, but I this is to do the SDK, so the Times hurt.

Then continue to find a solution. That is true:

Tragedies happen again, still more than 11

Then continue to look for, hey, found, found ...

So, capture the external touch and do the appropriate processing:

Rewrite ontouchevent

Finally found, there are problems, what problems? Is that the event will continue to pass, that is, you will click on the previous Activity of the control, thus triggering its click events, and so on, anyway, 10,000 unhappy.

So, return true to False to find also not (this means that my values are still correct.) )

No, just keep looking:

The final solution to find is this:

A bit similar to the previous one, is the capture of the effective area, invalid return ture; Rewrite dispatchtouchevent

Yes, right, that's the end of it.

Android-activity-dialog Theme Touch Outsize

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.