Note that there are some explanatory texts on larger screens.

plurals
  1. POOn click not working
    primarykey
    data
    text
    <p>Hi 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> <p>Mainmenu.java</p> <pre><code>Button.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> <p>Mainmenu.xml</p> <pre><code>&lt;/LinearLayout&gt; &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;/LinearLayout&gt; </code></pre> <hr> <p>help.xml</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: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;/LinearLayout&gt; </code></pre> <hr> <p>HelpActivity</p> <pre><code>public class HelpActivity extends Activity{ Button button1 ; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.help); } } </code></pre> <hr> <p>Am not sure what I missed out .... Please help</p>
    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.
 

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