I have a button that will lead you to a sample with a brief description, but what I would like to do is a long click and then allow the user to go to the site for more information.
here is my code for my button (regular)
<Button android:id="@+id/samplea" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_marginTop="20dp" android:background="@drawable/samplea_button" android:longClickable="true"/>
and my java is
Button next = (Button) findViewById(R.id.samplea); next.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { final ImageView imageView = (ImageView) findViewById(R.id.iM2); imageView.setImageResource(R.drawable.samplea_draw);
How do I add a longclickable ad to this to send me to the site? Can anybody help?
I added it, but now it seems to me that I got to this site (after a long click), but not to the image (after the usual onclick) heres my code:
next1.setOnLongClickListener(new OnLongClickListener() { public boolean onLongClick(View v) {
get the yellow line under "public void onClick (View view) {"
source share