---------- Forwarded message ---------- From: arun kumar <arun.kata...@gmail.com> Date: Wed, Jul 20, 2011 at 3:31 PM Subject: Re: context menu To: android-developers@googlegroups.com
On Wed, Jul 20, 2011 at 2:42 PM, arun kumar <arun.kata...@gmail.com> wrote: > hi > am having a 3 textviews one is placed at left (textview 1)and other > centre(textview2) and another at right (textview 3).. > > all 3 views are placed at the bottom of the layout......when i touch and > hold on textview 1,textview2 and textview3... a floating list of context > menu has to appear...... > > am getting that but the context menu taking the whole screen area ....when > i touch and hold on textview1 a context menu has to appear in textview1 > area only on the above of projects > when i touch and hold on textview 2 ..a context menu has to appear in > textview 2 area only......and similarly textview 3.... > > > > > > <LinearLayout android:orientation="vertical" > android:layout_width="fill_parent" android:layout_height="100dip" > > <RelativeLayout android:layout_alignParentBottom="true" > android:layout_height="wrap_content" android:layout_width="fill_parent" > android:orientation="horizontal" android:id="@+id/rl1"> > <TextView android:text="Projects" > android:layout_alignLeft="@+id/rl1" android:clickable="true" > android:id="@+id/t1" android:layout_height="wrap_content" > android:layout_width="100dip"></TextView> > <TextView android:text="Seminars" > android:layout_centerHorizontal="true" android:id="@+id/t2" > android:layout_height="wrap_content" > android:layout_width="100dip"></TextView> > <TextView android:text="Investments" > android:layout_alignParentRight="true" android:id="@+id/t3" > android:layout_height="wrap_content" > android:layout_width="100di"></TextView> > </RelativeLayout> > </LinearLayout> > > > final TextView tv1=( TextView)findViewById(R.id.t1); > tv1.setOnCreateContextMenuListener(new OnCreateContextMenuListener() { > > public void > onCreateContextMenu(ContextMenu menu, > View v, ContextMenuInfo menuInfo) { > > > menu.add("My Favorites"); > menu.add("My Projects"); > > } > }); > > final TextView tv2=( TextView)findViewById(R.id.t2); > tv2.setOnCreateContextMenuListener(new > OnCreateContextMenuListener() { > public void > onCreateContextMenu(ContextMenu menu, > View v, ContextMenuInfo menuInfo) { > // TODO Auto-generated method stub > > menu.add("All Projects"); > menu.add( "seminar"); > } > }); > final TextView tv3=( TextView)findViewById(R.id.t3); > tv3.setOnClickListener(new OnClickListener() { > public void onClick(View v) { > // TODO Auto-generated method stub > > tv3.setOnCreateContextMenuListener(new > OnCreateContextMenuListener() { > > > public void onCreateContextMenu(ContextMenu menu, > View v, ContextMenuInfo menuInfo) { > // TODO Auto-generated method stub > > menu.add("Myinvestmentdetails"); > > } > > }); > > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en