Encounter Problem with using both onLongclick and onClick on a single button linking to the same layout
<p>Here's my code, it does not have any errors and works fine. Currently, it has both <em>onLongClick</em> and <em>onClick</em> functions. on long click is to start the text to speech action and onclick to start intent for another activity. What works/what i want it to do:(when button is long-pressed text to speech is activated and when finger lifts, it enters intent)-- it works like that now. but i'm developing this code for the visually impaired and when the user uses this app, and accidentally touches the button <strong><em>NOTE</em></strong>(not long pressed). This also starts the intent linking to another activity without text to speech activating. so this is the flaw right now. i know i have to add conditions like if/else...etc but i'm a real beginner when it comes to that. can anyone solve this problem? Any help appreciated. Thanks in advance. :D</p>

<pre><code>public class APP extends Activity{

        private TextToSpeech tts;
        private ImageButton b1,b1a,b2,b2a,b3,b3a,b4,b4a; 


        @Override
        public void onCreate(Bundle savedInstanceState) {

            super.onCreate(savedInstanceState);
            setContentView(R.layout.main);

            /** Called when the activity is first created. */
            setContentView(R.layout.main);
            tts = new TextToSpeech (this, null);
            b1 = (ImageButton)findViewById(R.id.btn_time);
            b1.setOnLongClickListener(new ImageButton.OnLongClickListener(){


                @Override
                   public boolean onLongClick(View arg0) {

                    String hi = "Time";
                    tts.speak(hi, 0, null);

                    return false;

                }});

                b1a = (ImageButton)findViewById(R.id.btn_time);
                b1a.setOnClickListener(new Button.OnClickListener(){

                public void onClick(View arg0){
                {

                    Intent i = new Intent("net.learn2develop.TIME");
                    startActivity(i);
                }
              }
           });
</code></pre>
