Contoh kode: Mengambil profil pengguna
Contoh kode berikut mengasumsikan bahwa kelas yang menampilkan MyUserProfileScreen telah memberikan referensi untuk objek BBMPlatformContext yang terkait dengan aplikasi ini ke konstruktor MyUserProfileScreen.
import net.rim.blackberry.api.bbm.platform.*;
import net.rim.blackberry.api.bbm.platform.profile.*;
import net.rim.device.api.ui.container.*;
import java.util.*;
public class MyUserProfileScreen extends MainScreen
{
public MyUserProfileScreen(BBMPlatformContext platformContext)
{
UserProfile userProfile = platformContext.getUserProfile();
String displayName = userProfile.getDisplayName();
Bitmap displayPicture = userProfile.getDisplayPicture();
String personalMsg = userProfile.getPersonalMessage();
int status = userProfile.getStatus();
String statusMsg = userProfile.getStatusMessage();
}
}
Topik berikutnya: Memperbarui profil pengguna
Topik sebelumnya: Mengambil profil pengguna
Apakah informasi ini berguna? Kirimkan komentar Anda kepada kami.