---------- Forwarded message ---------- From: arun kumar <[email protected]> Date: Sat, Jul 30, 2011 at 11:17 AM Subject: Fwd: contextmenu on item selected has to display next activity To: [email protected]
---------- Forwarded message ---------- From: arun kumar <[email protected]> Date: Sat, Jul 30, 2011 at 10:16 AM Subject: contextmenu on item selected has to display next activity To: [email protected] HI i given buttons in xml file and onclick listener in java. 1).when i click on button (projects)menu has to appear(allprojects,myprojects,myfavorites)....it appearing but when i click allprojects it has to show the next acitvity(allprojects class) but its not displaying the activity...... 2)context menu is displaying at the centre of the screen ...how to make it to display at the bottom of the layout... <Button android:text="Projects" android:textColor="#ffffff" android:textSize="17dip" android:background="#bebebe" android:layout_weight="1" android:layout_alignLeft="@+id/rl1" android:clickable="true" android:id="@+id/t1" android:layout_height="wrap_content" android:layout_width="wrap_content"></Button> <Button android:text="Seminars" android:textColor="#ffffff" android:textSize="17dip" android:background="#bebebe" android:layout_weight="1" android:layout_centerHorizontal="true" android:id="@+id/t2" android:layout_height="wrap_content" android:layout_width="wrap_content"></Button> final Button bt1=( Button)findViewById(R.id.t1); bt1.setOnCreateContextMenuListener(new OnCreateContextMenuListener() { public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) { // TODO Auto-generated method stub menu.add(0,1,0,"All Projects"); menu.add(0,2,0,"My Favorites"); menu.add(0,3,0,"My Projects"); } public void onContextItemSelected(MenuItem item) { if (item.getItemId() == 1) { Intent intent=new Intent(WelcomePage.this,AllProjects.class); startActivity(intent); } else{ } } }); Thanks in advance -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

