android tutorial - Basic Activity structure in Android Activity | Developer android - android app development - android studio - android app developement



Basic Activity structure

MainActivity.java

public class MainActivity extends Activity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Toast.makeText(this, "Activity created sucessfully!", Toast.LENGTH_LONG).show();
    }
}
click below button to copy code from our android learning website - android tutorial - team
  • AndroidManifest.xml (should be edited)
<manifest ... >
    <application ... >
        <activity
            android:name=".MainActivity"
            android:theme="@android:style/Theme.AppCompat">
        </activity>
    </application>
</manifest>
click below button to copy code from our android learning website - android tutorial - team

Related Searches to Basic Activity structure in Android Activity