Android Chinese API (134) -- Account

Source: Internet
Author: User

 

Preface

This chapter content is android. account. Account, version for Android 4.0 r1, translated from "Zhang Yi", welcome to his blog: "http://xiaoy.sinaapp.com/", thank you again "Zhang Yi "! Welcome to join in Android Chinese translation, contact me over140@gmail.com.

 

Statement

You are welcome to repost, but please keep the original source of the article :)

Blog Garden: http://www.cnblogs.com/

Android Chinese translation group: http://goo.gl/6vJQl

 

 

Account

Translator's signature: Zhang Yu

Link: http://xiaoy.sinaapp.com/

Version: Android 4.0 r1

 

Structure

Inheritance relationship

Public class Account extends Object implements Parcelable

Java. lang. Object

Android. accounts. Account

 

Class Overview

The value type indicatesAccountManager. This object implementsParcelableAnd overwrittenEquals (Object)AndHashCode ()So that it can be usedMap.

 

Constant

Public static final Creator <Account>CREATOR

 

Public final StringName

 

Public final StringType

 

Constructor

PublicAccount(String name, String type)

 

PublicAccount(Parcel in)

 

Common Methods

Public intDescribeContents()

Describes various objects with special meanings that are included in the Parcelable configuration.

Return Value

A single bit mask describes the settings of special types of Parcelable objects.

 

Public booleanEquals(Object o)

Compares the instances of the specified object and returns whether they are equal. To ensure their equality, parameter o must represent the same object, which serves as a constant for comparing class dependencies. It is usually agreed that the comparison should be self-inverse, symmetric, and transmitted. In addition, there is no object reference unless null is equal to null.

Returns true by default only when this = o. If you want to implement your own equals method, see compile a correct equals method.

Equals andHashCode ()The General Convention of the method is that if any two objects are equal, true is returned, and the hashCode () of the two objects must return the same value. This indicates that the subclass object is usually overwritten by two methods or both methods.

Parameters

O objects compared by this instance

Return Value

If the specified object is equal to this object, true is returned. Otherwise, false is returned.

 

Public intHashCode()

Returns an integer Hash code of the current object. By convention, any twoEquals (Object)The object that returns true must return the same hash value. This indicates that the subclass object is usually overwritten by two methods or both methods.

Note that the hash value does not change with time unless the equals comparison changes.

If you want to implement your own hashCode method, see compile a correct hashCode method.

Return Value

The hash value of the object.

 

Public StringToString()

Returns a simple and understandable second-rate information of an object. We encourage you to rewrite this method and provide implementations that take into account types and data. The default implementation is equivalent to the following expressions:

GetClass (). getName () + '@' + Integer. toHexString (hashCode ())

If you want to implement your own toString method, see compile a correct toString method.

Return Value

A printable string representing this object

 

Public voidWriteToParcel(Parcel dest, int flags)

Write this object to Parcel

Parameters

The Parcel object to which dest should be written

The additional flags on how the object should be written. It may be 0 orPARCELABLE_WRITE_RETURN_VALUE.

 

Supplement

Article Selection

Account Management for Android-specific development

Android app development notes (7): build your own Android account and content synchronization mechanism

Related Article

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.