Quantcast
Channel: Appcelerator Developer Center Q&A Tag Feed (android)
Viewing all articles
Browse latest Browse all 7655

Android Multiple Views event fires simultaneously

$
0
0

Hello Community, I have strange issue in my ios and android app which is a major issue for my client. I have 6 views on my home screen and if user push("touch", "click", "singletap") on 2 views on same time then 2 events fire at same time. please suggest me how to avoid this issue. i have 2 below view and if user push on both views at same time app performs 2 task and displayed 2 alert.

//if you will push on both view at same time both events will be fired.
var FireView = Ti.UI.createView({
        top : '70dp',
        width : '100dp',
        height : '100dp',
        right : 0,
        layout : 'vertical',
        backgroundColor : '#FFD13A'
    });
 
var MedicalView = Ti.UI.createView({
        top : FireView.top + FireView.height +'10dp',
        width : '100dp',
        height : '100dp',
        right : 0,
        layout : 'vertical',
        backgroundColor : '#4faa58'
    });
//use click, singletap, touchstart or touchend still both events fired if you will push on same view at same time
FireView.addEventListener('singletap', function(e) {
alert("FireView");
});
//use click, singletap, touchstart or touchend still both events fired if you will push on same view at same time
MedicalView.addEventListener('singletap', function(e) {
alert("MedicalView");
});
Please suggest me a solution for it.Thanks a ton in advance.

Viewing all articles
Browse latest Browse all 7655

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>