Narendra
Narendra

Reputation: 1868

Fields of the Message class

Which fields of the Message class which should be used to store custom message codes about the Message? Please any one tell me fields of the message class which used for store custom message. Thanks.

Upvotes: 1

Views: 3319

Answers (2)

sivi
sivi

Reputation: 11114

http://developer.android.com/reference/android/os/Message.html

public int what Added in API level 1

User-defined message code so that the recipient can identify what this message is about. Each Handler has its own name-space for message codes, so you do not need to worry about yours conflicting with other handlers.

Upvotes: 1

AAnkit
AAnkit

Reputation: 27549

you can store your message codes in arg1 and arg2 of message object.... U can also store your message data in object field of message.. like below

String str= "Message content";
Message ms = new Message();
ms.arg1 =0;
ms.arg2 = 1;
ms.obj = str;

Upvotes: 2

Related Questions