




















































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





















































package com.rohit.hello import android.support.v7.app.AppCompatActivity import android.os.Bundle class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout. activity_main ) } }
android:layout_height="wrap_content" android:text="Hello World!" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent"/>
Create and manage virtual devices:
#008577 #00574B #D81B60
hello
1 2 3
package com.rohit.drwable import android.support.v7.app.AppCompatActivity import android.os.Bundle class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) setContentView(R.layout. activity_main ) } }
import android.os.Bundle import android.support.design.widget.Snackbar import android.support.v7.app.AppCompatActivity import android.view.Menu import android.view.MenuItem import android.util.Log import kotlinx.android.synthetic.main.activity_state_change.* class StateChangeActivity : AppCompatActivity() { val TAG = "StateChange" override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R. layout. activity_state_change ) setSupportActionBar(toolbar) fab.setOnClickListener { view -> Snackbar.make(view, "Replace with your own action", Snackbar. LENGTH_LONG )
.setAction("Action", null).show() } Log.i(TAG, "onCreate") } } override fun onStart() { super.onStart() Log.i(TAG, "onStart") } override fun onResume() { super.onResume() Log.i(TAG, "onResume") } override fun onPause() { super.onPause() Log.i(TAG, "onPause") } override fun onStop() { super.onStop() Log.i(TAG, "onStop") } override fun onRestart() { super.onRestart() Log.i(TAG, "onRestart") } override fun onDestroy() { super.onDestroy() Log.i(TAG, "onDestroy") } override fun onSaveInstanceState(outState: Bundle?) { super.onSaveInstanceState(outState) Log.i(TAG, "onSaveInstanceState") } override fun onRestoreInstanceState(savedInstanceState: Bundle?) { super.onRestoreInstanceState(savedInstanceState) Log.i(TAG, "onRestoreInstanceState") }