Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to implement a "click-anywhere-to-continue" event on my android activity?

Tags:

android

Is this possible?

I would display an activity that shows a welcome page, and that welcome page doesn't have any Views where I can attach an onClickListener.

EDIT: ok, the reason for this welcome kind of welcome page, is that this application is used to take something like a survey... after a customer is done with the survey, the app returns to this welcome page so another person can take the survey again.

like image 222
lock Avatar asked Jan 18 '26 20:01

lock


1 Answers

Yes, if the original layout is somehow not appropriate, use a FrameLayout at the top level of your layout to achieve this. FrameLayout allows stackable views/layouts, so you can have your existing view as the bottom layer, and then a transparent view on top that listens for the touch event:

    <FrameLayout 
        android:layout_width="fill_parent"
        android:layout_height="fill_parent">
        <!-- Put your complete original layout/view here -->
        <View
            android:id="@+id/view_to_listen_for_touch"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
        />
    </FrameLayout>
like image 135
pents90 Avatar answered Jan 21 '26 07:01

pents90



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!