while showing progress bar i want to disable touch screen to restrict other functionalities in android phone.
can any one guide me how to achieve this?
any help would be appricated.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
EDIT
You can do it by implementing a custom extension of ListView which you set as the list to use in your XML file. Then in your CustomListView, implement the onTouchEvent method and only call super.onTouchEvent if you want the touch to be processed by the list. Here’s what I mean:
Have something to this effect in the layout file that contains your list.
Then have a custom class like this:
This code will only allow touch events to get processed by the ListView if they’re in the top 100 pixels of the screen. Obviously, replace that if statement with something more appropriate for your application. Also don’t leave in the Log statements once you’ve got it to work since you’ll spam yourself with hundreds of logging lines after each gesture; they’re only their to make obvious what is happening.