Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>here is the simple code how you can load one activity to another,</p> <p>i have created two activities like this</p> <h2>FirstActivity.java</h2> <pre><code>package com.rdc; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; public class FirstActivity extends Activity implements OnClickListener { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.first); Button btnload = (Button) findViewById(R.id.btn); btnload.setOnClickListener(this); } @Override public void onClick(View v) { // TODO Auto-generated method stub Intent i = new Intent(this, SecondActivity.class); startActivity(i); } } </code></pre> <hr> <h2>SecondActivity.java</h2> <pre><code>package com.rdc; import android.app.Activity; import android.os.Bundle; public class SecondActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.second); } } </code></pre> <hr> <p>and my manifest file is</p> <h2>AndroidManifest.xml</h2> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.rdc" android:versionCode="1" android:versionName="1.0"&gt; &lt;uses-sdk android:minSdkVersion="8" /&gt; &lt;application android:icon="@drawable/icon" android:label="@string/app_name"&gt; &lt;activity android:name=".FirstActivity" 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=".SecondActivity" android:label="@string/app_name"&gt; &lt;intent-filter&gt; &lt;category android:name="android.intent.category.LAUNCHER" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; &lt;/application&gt; &lt;/manifest&gt; </code></pre> <hr> <p>try to implement this in your app and let me know if still any doubt is there.</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.
 

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