On click not working
pHi guys I am working on an application in which I designed a Help button
on the Main Menu . I copied a customized help image file in the drawable
folder and created a Help.xml file to embed it in the layout . My
functionality demands that simply on click of this help button on the main
menu , the help.xml containing the help image should pop up . but nothing
happens when I click help . /p hr pMainmenu.java/p
precodeButton.OnClickListener mClickListener = new View.OnClickListener()
{ Animation anim = null; @Override public void onClick(View v) { Vibrator
vibe = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
vibe.vibrate(60); switch (v.getId()) { case R.id.BtnDisplay:
mpool.play(mlogon, 1, 1, 0, 0, 1); anim = new ScaleAnimation(0, 1, 0, 1,
Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
anim.setDuration(100); mBtn1.startAnimation(anim); Intent intent = new
Intent(NUGA_MainMenuActivity.this, FileSiganlDisplay.class);
startActivity(intent);
//overridePendingTransition(R.anim.zoom_enter,R.anim.zoom_exit);
overridePendingTransition(R.anim.fade, R.anim.hold); break; case
R.id.BtnSlave: mpool.play(mlogon, 1, 1, 0, 0, 1); anim = new
ScaleAnimation(0, 1, 0, 1, Animation.RELATIVE_TO_SELF, 0.5f,
Animation.RELATIVE_TO_SELF, 0.5f); anim.setDuration(100);
mBtn2.startAnimation(anim); Intent intent1 = new
Intent(NUGA_MainMenuActivity.this, BTSmartSlavemodule.class);
startActivity(intent1); //overridePendingTransition(R.anim.zoom_enter,
R.anim.zoom_exit); overridePendingTransition(R.anim.fade, R.anim.hold);
break ; case R.id.takeashot: //snapFunction(); Intent intent2=new
Intent(NUGA_MainMenuActivity.this,ImagesActivity.class);
startActivity(intent2); break; case R.id.takehelp : Intent intent3=new
Intent(NUGA_MainMenuActivity.this,HelpActivity.class);
startActivity(intent3); break; default: break; } } };
-------------------------------------------------------------------------------------------------
/code/pre pMainmenu.xml/p precodelt;/LinearLayoutgt; lt;Button
android:id=@+id/BtnSlave android:layout_width=fill_parent
android:layout_height=wrap_content android:layout_marginLeft=10dip
android:layout_marginRight=10dip
android:gravity=center_vertical|center_horizontal
android:text=@string/mes_mod_linked android:background=@color/btn_red
android:textColor=#315683 android:textSize=30px /gt; lt;Button
android:id=@+id/takeashot android:layout_width=fill_parent
android:layout_height=wrap_content
android:gravity=center_vertical|center_horizontal
android:text=@string/History android:layout_marginLeft=10dip
android:layout_marginRight=10dip android:background=@color/btn_purple
android:textColor=#315683 android:textSize=30px /gt; lt;Button
android:id=@+id/takehelp android:layout_width=fill_parent
android:layout_height=wrap_content
android:gravity=center_vertical|center_horizontal
android:text=@string/Help android:layout_marginLeft=10dip
android:layout_marginRight=10dip android:background=@color/btn_yellow
android:textColor=#315683 android:textSize=30px /gt; lt;/LinearLayoutgt;
/code/pre hr phelp.xml/p precodelt;?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:background=@drawable/mainbackground android:orientation=vertical
gt; lt;ImageView android:layout_width=wrap_content
android:layout_height=match_parent
android:background=@drawable/helppicture /gt; lt;/LinearLayoutgt;
/code/pre hr pHelpActivity/p precodepublic class HelpActivity extends
Activity{ Button button1 ; @Override protected void onCreate(Bundle
savedInstanceState) { super.onCreate(savedInstanceState);
setContentView(R.layout.help); } } /code/pre hr pAm not sure what I missed
out .... Please help/p
No comments:
Post a Comment