How can I disable the multi-touch and the pulling from my activity

后端 未结 1 1334
被撕碎了的回忆
被撕碎了的回忆 2021-01-25 20:37

I want disable the multi-touch action and the pulling action from my screen and from my activity. I want only use the impact action for my activity. How can I do it?

I

相关标签:
1条回答
  • 2021-01-25 21:08

    If I'm to understand your question correctly, I think you want to use an OnClickListener instead of an OnTouchListener.

    Try this:

    a.setOnClickListener(new OnClickListener()
    {
        @Override
        public void onClick(View arg0)
        {
            B b = new B(getApplicationContext());
            relativeLayout.addView(b);
        }
    });
    

    This is assuming you want to tap anywhere within a to add b to your relativeLayout. If you want to tap a specific area within a you should add a new view to a that covers that area and then add the click listener to that new view.

    0 讨论(0)
提交回复
热议问题