Accessing widget

270 views
189 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
270
On SlideShare
0
From Embeds
0
Number of Embeds
15
Actions
Shares
0
Downloads
4
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Accessing widget

  1. 1. Accessing Widget By Durai. Sduraisy2k@gmail.com
  2. 2. XML File
  3. 3. Generated File
  4. 4. JAVA File● Map a Widget in Java: Class ob=(Class)findViewById(id name in xml); ex: Button btn=(Button)findViewById(R.id.btn);● Toast: Notify some information to User Syntax: Toast.makeText(Context(), Text, duration).show(); Context() --> current class Text --> Message to display Duration --> duration to display LENGTH_LONG,LENGTH_SHORT
  5. 5. JAVA File
  6. 6. Output
  7. 7. Create a EditText
  8. 8. Set data in EditText
  9. 9. Output

×