Android programming: View and Intent classes, androidintent

Source: Internet
Author: User

Android programming: View and Intent classes, androidintent

=== Basic methods of the View class ====
SetBackgroundColor (int color)
Set the attempted background color

SetBackgroundDrawable (Drawable d)
Set the view background image

SetMinimumHeight (int minHeight)
Set the minimum height. The parent class may reset

SetMinimumWidth (int minWidth)
Set the minimum width. The parent class may reset

SetPadding (int left, int right, int top, int bottom)
Set padding Property

SetClickable (boolean c)
Set whether the view responds to the click

SetFocusable (boolean f)
Set the view response focus

SetOnClickListener (OnClickListener l)
Set Click Event listener

SetOnFocusChangeListener (OnFocusChangeListener l)
Set the focus change listener

SetLayoutParams (ViewGroup. LayoutParams l)
Set layout Parameters

=== Intent class description ====
Intents consists of three parts: action, policy, and data
Actions and policies are represented by a String object, and data can be any object.
Actions and policies are defined in the AndroidManifest. xml file, and the data is specific.
The data sent by the Activity class instance to the Instance Object responding to Intents

Action type
Intent. ACTION_VIEW
-- Open the application
-- Map Program (geo: xxx)
-- Web browser (http:/xxx, https: // xxx)

Intent. ACTION_CALL
-- Call Program (tel: xxx, voicemail: xxx)

Intent. ACTION_DIAL
-- Dialing program (tel: xxx, voicemail: xxx)

Intent. ACTION_WEB_SEARCH
-- Open search engine (Text Information)

Broadcast API Interface
SendBroadcast (Intent intent)
Send a broadcast message

SendBroadcast (Intent intent, String receiverPermission)
Send broadcast messages that can be claimed by a specific permission

In particular, broadcast actions
ACTION_TIME_TICK -- send once per minute, which can be used for time monitoring
ACTION_TIME_CHANGED -- time modified by the user
ACTION_TIMEZONE_CHANGED -- the user changed the time zone.
ACTION_BOOT_COMPLETED -- the system is fully started.
ACTION_PACKAGE_ADDED -- Software Installation Complete
ACTION_PACKAGE_REMOVED -- software deleted
ACTION_BATTERY_CHANGED -- battery power change

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.