Android Programming Lecture 4 Activity, Intent and U
Android Programming Lecture 4 Activity, Intent and UI
package com. example. editgreeting: import android app. Activity;l Superclass public class MainActivity extends Activity EditText e; TextView t: Button b protected void onCreate(Bundle savedInstancestate)t super onCreate (savedInstancestate) setContentView(R layout activity main); e =(EditTextfindviewById(rid. myEdit Text) (TextView)findviewById(r id my Textview) b = Button)findViewById(R id my Button), Constructor b. setonClickListener (new MyButtononClickListener() class My ButtonOnClickListener implements pnClickListene @Override Interface Inner class public void onclick(View v)i // TODO Auto-generated method stub t setText(e getText
2 Superclass Interface Constructor Inner class
RoadMap and Learning Objectives Learn to use the basic ul widgets Learn to switch Activities using Explicit Intent
RoadMap and Learning Objectives • Learn to use the basic UI widgets • Learn to switch Activities using Explicit Intent 3
Ul Development
UI Development 4
Basic Input Controls Input controls are used Button to take data from user Wic idgets Text field OFF Textview a Button Check Box Textview Large Medium Small RadioButton Button Smal OFF ˇ CheckBox, RadioButton a Spinner CheckedTextview Spinner o Text fields Dialogs 5
Basic Input Controls • Input controls are used to take data from user o Widgets ▪ TextView ▪ Button ▪ CheckBox ▪ RadioButton ▪ Spinner o Text Fields o Dialogs 5