Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>In AndroidManifest must be:</p> <pre><code> &lt;activity android:name="MainActivity" android:label="@string/app_name"&gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.MAIN"/&gt; &lt;category android:name="android.intent.category.LAUNCHER"/&gt; &lt;/intent-filter&gt; &lt;/activity&gt; &lt;activity android:name=".ViewImave"/&gt; </code></pre> <p>in MainActivity.java</p> <pre><code>public class MainActivity extends Activity implements View.OnClickListener { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); final Button button1 = (Button)findViewById(R.id.button1); button1.setText("take Image"); button1.setOnClickListener(this); final Button button2 = (Button)findViewById(R.id.button2); button2.setText("take Image2"); button2.setOnClickListener(this); } @Override public void onClick(View v) { switch (v.getId()){ case R.id.button1: { Intent showImageIntent = new Intent(this, ViewImave.class); startActivity(showImageIntent); break; } case R.id.button2: { Toast toast = Toast.makeText(this, "onClickButton2", Toast.LENGTH_SHORT); toast.show(); break; } } } } </code></pre> <p>in ViewImave.java</p> <pre><code>public class ViewImave extends Activity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.showimage); Toast toast = Toast.makeText(this, "new image on create", Toast.LENGTH_SHORT); toast.show(); } } </code></pre> <p>Check it. Hope it's help</p>
    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.
 

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