Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can do it as follows. Make an xml with two buttons i.e piping and tubing in the java file for the xml, set listener for the buttons. In the listeners, try starting a new activity.</p> <p>xml file can be like this,</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#9999FF" &gt; &lt;TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="center_horizontal" android:text="Main Menu" android:textStyle="bold" android:textSize="15px" android:paddingTop="10px" android:paddingBottom="10px" android:textColor="#FFFFFF" android:background="#9966FF" /&gt; &lt;Button android:layout_width="wrap_content" android:text="Purchase Requisition" android:layout_marginLeft="60px" android:layout_height="35px" android:id="@+id/purchaseRequisitonButton" android:layout_marginTop="40px" /&gt; &lt;Button android:layout_width="wrap_content" android:text="Purchase Order" android:layout_marginLeft="65px" android:layout_height="35px" android:id="@+id/purchaseOrderButton" android:layout_marginTop="10px" /&gt; &lt;/LinearLayout&gt; </code></pre> <p>Java file for this can be like...</p> <pre><code>package guide.training.iApproval; import android.accounts.OnAccountsUpdateListener; import android.app.Activity; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.Toast; public class MainMenu extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.mainmenu); Button purchaseRequisitionButton = (Button) findViewById(R.id.purchaseRequisitonButton); Button purchaseOrderButton = (Button) findViewById(R.id.purchaseOrderButton); //Listener for the Purchase Requisition button purchaseRequisitionButton.setOnClickListener (new Button.OnClickListener() { public void onClick(View v) { Intent intent = new Intent(MainMenu.this,guide.training.iApproval.myJava.class); startActivity(intent); } } ); //Listener for the Purchase Order button purchaseOrderButton.setOnClickListener (new Button.OnClickListener() { public void onClick(View v) { } } ); } } </code></pre>
    singulars
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      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