|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--net.rim.blackberry.api.bbm.platform.BBMPlatformContextListener
Receives and handles status change events related to the BBMPlatformContext.
| Constructor Summary | ||
BBMPlatformContextListener()
|
||
| Method Summary | ||
abstract void |
accessChanged(boolean isAccessAllowed,
int accessErrorCode)
Called when the access to BBM for the plugin has changed. |
|
void |
appInvoked(int reason,
Object param)
Deprecated. Use {@link appInvoked(int, Object, Presence) |
|
void |
appInvoked(int reason,
Object param,
Presence user)
Called in certain cases when the application is invoked from within BBM. |
|
| Constructor Detail |
| Method Detail |
public abstract void accessChanged(boolean isAccessAllowed,
int accessErrorCode)
isAccessAllowed - whether access to BBM is allowedaccessErrorCode - the error code that explains why access to BBM is not allowed.
Codes are defined in BBMPlatformContext.
public void appInvoked(int reason,
Object param)
UserProfileBox).
This callback will be invoked with the reason BBMPlatformContext.INVOKE_PROFILE_BOX_ITEM
and a UserProfileBoxItem param -- the profile box item which was clicked.
appInvoked(int reason, Object param) {
if(reason == BBMPlatformContext.INVOKE_PROFILE_BOX_ITEM) {
UserProfileBoxItem clickedItem = (UserProfileBoxItem) param;
// Handle profile box item click...
}
}
Note: This will only be invoked once platform access is allowed.reason - How the application was invoked. One of the INVOKE_* constants in BBMPlatformContext.param - Parameter associated with the invocation.UserProfileBox
public void appInvoked(int reason,
Object param,
Presence user)
The param and user parameters are dictated by the invocation
reason. See the INVOKE_* constants in BBMPlatformContext.
Note: This will only be invoked once platform access is allowed.
Example:
public void appInvoked(int reason, Object param, Presence user) {
// User clicked a user's profile box
if(reason == BBMPlatformContext.INVOKE_PROFILE_BOX) {
// e.g. Show detail for user's whole TPA profile box
// User clicked a user's profile box item
} else if(reason == BBMPlatformContext.INVOKE_PROFILE_BOX_ITEM) {
// e.g. Show the score and trophy represented by a profile box item
UserProfileBoxItem item = (UserProfileBoxItem) param;
int score = Integer.parseInt(item.getCookie());
// User clicked a user's personal message TPA link
} else if(reason == BBMPlatformContext.INVOKE_PERSONAL_MESSAGE) {
// e.g. Allow the user to comment on the user's personal message in the user's TPA profile
String personalMessage = (String) param;
// User clicked a contact's chat message TPA link
} else if(reason == BBMPlatformContext.INVOKE_CHAT_MESSAGE) {
// e.g. Start an activity with the contact
}
}
reason - How the application was invoked. See the INVOKE_* constants in BBMPlatformContext.param - Parameter associated with the invocation. May be null. Dictated by reason.user - User associated with the invocation. May be null, and may be the current user. Dictated by reason.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Copyright 1999- Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.