Note that there are some explanatory texts on larger screens.

plurals
  1. POhave a clickable buttons in zoomview in android
    primarykey
    data
    text
    <p>i want clickable buttons in zoomview .but my problem is that when i set the view in zoomview then buttons are not responding while click,i am stuck at this point any help is apreciated </p> <p>my code is</p> <pre><code>public class SongsActivity extends Activity { ImageView imvw; DrawView drawView; ImageView imageView; View dv; RelativeLayout rdown; private static final float MIN_ZOOM = 1f, MAX_ZOOM = 1f; Matrix matrix = new Matrix(); Matrix savedMatrix = new Matrix(); static final int NONE = 0; static final int DRAG = 1; static final int ZOOM = 2; private static final RelativeLayout New = null; int mode = NONE; PointF start = new PointF(); PointF mid = new PointF(); float oldDist = 1f; RelativeLayout main_container; private ZoomView zoomView; Button BtnWelcome; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.songs_layout); try{ imvw = (ImageView) findViewById(R.id.imageView1); View v = ((LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE)) .inflate(R.layout.songs_layout, null, false); BtnWelcome = (Button) findViewById(R.id.button4); v.setLayoutParams(new RelativeLayout.LayoutParams( LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT)); main_container = (RelativeLayout) findViewById(R.id.Map); zoomView = new ZoomView(this); zoomView.addView(v); main_container.addView(zoomView); //BtnWelcome.bringToFront(); BtnWelcome.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { // TODO Auto-generated method stub Intent intent = new Intent(SongsActivity.this, Wavepointsactivity.class); intent.putExtra("Welcome", "Welcome"); startActivity(intent); } }); }catch (Exception e) { // TODO: handle exception } } } </code></pre> <p>and my xml is</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" &gt; &lt;!-- Screen Design for the SONGS --&gt; &lt;RelativeLayout android:id="@+id/tabconteffnt" android:layout_width="match_parent" android:layout_height="50dp" android:layout_gravity="top" android:background="#2E2E2E" android:gravity="center_horizontal" &gt; &lt;TextView android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="10dp" android:text="Cedar Breaks-Map" android:textAppearance="?android:attr/textAppearanceMedium" android:textColor="@android:color/white" /&gt; &lt;/RelativeLayout&gt; &lt;RelativeLayout android:id="@+id/Map" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_gravity="top" android:gravity="center_horizontal" &gt; &lt;ImageView android:id="@+id/imageView1" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_alignParentBottom="true" android:layout_alignParentLeft="true" android:layout_marginBottom="70dp" android:scaleType="fitXY" android:src="@drawable/map" /&gt; &lt;Button android:id="@+id/button4" style="?android:attr/buttonStyleSmall" android:layout_width="50dp" android:layout_height="50dp" android:layout_alignParentRight="true" android:layout_below="@+id/button3" android:layout_marginRight="37dp" /&gt; &lt;Button android:id="@+id/button5" style="?android:attr/buttonStyleSmall" android:layout_width="40dp" android:layout_height="60dp" android:layout_below="@+id/button4" android:layout_toLeftOf="@+id/button4" android:text="Button" /&gt; &lt;Button android:id="@+id/button6" style="?android:attr/buttonStyleSmall" android:layout_width="50dp" android:layout_height="50dp" android:layout_alignLeft="@+id/button5" android:layout_below="@+id/button5" android:layout_marginTop="18dp" android:text="Button" /&gt; &lt;Button android:id="@+id/button7" style="?android:attr/buttonStyleSmall" android:layout_width="50dp" android:layout_height="50dp" android:layout_below="@+id/button6" android:layout_centerHorizontal="true" android:layout_marginTop="21dp" android:text="Button" /&gt; &lt;Button android:id="@+id/button3" style="?android:attr/buttonStyleSmall" android:layout_width="30dp" android:layout_height="30dp" android:layout_below="@+id/button2" /&gt; &lt;Button android:id="@+id/button11" style="?android:attr/buttonStyleSmall" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignTop="@+id/button9" android:text="Button" /&gt; &lt;Button android:id="@+id/button10" style="?android:attr/buttonStyleSmall" android:layout_width="50dp" android:layout_height="50dp" android:layout_above="@+id/button9" android:layout_alignRight="@+id/button11" android:text="Button" /&gt; &lt;Button android:id="@+id/button8" style="?android:attr/buttonStyleSmall" android:layout_width="50dp" android:layout_height="50dp" android:layout_alignBaseline="@+id/button10" android:layout_alignBottom="@+id/button10" android:text="Button" /&gt; &lt;Button android:id="@+id/button9" style="?android:attr/buttonStyleSmall" android:layout_width="50dp" android:layout_height="50dp" android:layout_alignBaseline="@+id/button7" android:layout_alignBottom="@+id/button7" android:layout_alignLeft="@+id/button8" android:text="Button" /&gt; &lt;Button android:id="@+id/button2" style="?android:attr/buttonStyleSmall" android:layout_width="30dp" android:layout_height="30dp" android:layout_alignLeft="@+id/button3" /&gt; &lt;RelativeLayout android:id="@+id/view1" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_alignBottom="@+id/imageView1" android:layout_alignLeft="@+id/view1" &gt; &lt;/RelativeLayout&gt; &lt;/RelativeLayout&gt; &lt;/LinearLayout&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload