public static void init() { CURRENT = new Profile(); }
Profile profile = Profile.getCurrentProfile(); if (profile != null) { Toast.makeText(MainActivity.this, profile.getName(), Toast.LENGTH_SHORT).show(); loadImages(profile.getProfilePictureUri(120, 120).toString()); profileName.setText(profile.getName()); mDrawer.getMenu().findItem(R.id.nav_myAccount).setVisible(false); Bundle extra = getIntent().getExtras(); String email; if (extra != null) { email = extra.getString("email"); profileEmail.setText(email); Toast.makeText(MainActivity.this, email, Toast.LENGTH_SHORT).show(); } else if (sessionManagerFacebook.isLoggedIn()) { profileEmail.setText(userFacebook.get(SessionManagerFacebook.KEY_EMAIL)); Toast.makeText(MainActivity.this, userFacebook.get(SessionManagerFacebook.KEY_EMAIL), Toast.LENGTH_SHORT).show(); } }
public static ProfileInfoRepresentation create() { ProfileInfoRepresentation info = new ProfileInfoRepresentation(); info.name = Profile.getName(); info.disabledFeatures = names(Profile.getDisabledFeatures()); info.previewFeatures = names(Profile.getPreviewFeatures()); info.experimentalFeatures = names(Profile.getExperimentalFeatures()); return info; }
LoginManager.getInstance().registerCallback(callbackManager, new FacebookCallback<LoginResult>() { @Override public void onSuccess(final LoginResult loginResult) { if(Profile.getCurrentProfile() == null) { mProfileTracker[0] = new ProfileTracker() { @Override protected void onCurrentProfileChanged(Profile profile, Profile profile2) { Log.v("facebook - profile", profile2.getFirstName()); storeLogin(profile2.getName(), profile2.getProfilePictureUri(450, 450).toString(), loginResult.getAccessToken().getUserId()); openMainActivity(profile2.getName(), profile2.getProfilePictureUri(450, 450).toString(), loginResult.getAccessToken().getUserId()); loadingFace.dismiss(); mProfileTracker[0].stopTracking(); } }; mProfileTracker[0].startTracking(); } else { Profile profile = Profile.getCurrentProfile(); storeLogin(profile.getName(), profile.getProfilePictureUri(450, 450).toString(), loginResult.getAccessToken().getUserId()); openMainActivity(profile.getName(), profile.getProfilePictureUri(450, 450).toString(), loginResult.getAccessToken().getUserId()); loadingFace.dismiss(); } } @Override public void onCancel() { ....
holder.position = position; Profile contact = listCont.get(position); holder.text.setText(contact.getName()); ImageView photo = (ImageView ) convertView.findViewById(R.id.quickContactBadge1); photo.setTag(contact.getMobileNo()); photo.setImageResource(R.drawable.stub_image); new LoadImage(photo).execute(contact.getMobileNo());
public View getView(int position, View convertView, ViewGroup parent) { ViewHolder holder; if (convertView == null) { convertView = mInflater.inflate(R.layout.lis_item,parent, false); holder = new ViewHolder(); holder.tv = (TextView) convertView.findViewById(R.id.name_view); holder.iv = (ImageView)convertView.findViewById(R.id.default_icon_view); convertView.setTag(holder); } else { holder = (ViewHolder) convertView.getTag(); } Profile profile = profiles.get(position); if (profile.checkDefault()) { holder.iv.setImageResource(R.drawable.ic_launcher); } else { holder.iv.setImageResource(R.drawable.android_icon); } holder.tv.setText(profile.getName()); return convertView; }
@Override public boolean isSupported() { return Profile.isFeatureEnabled(Profile.Feature.AUTHZ_DROOLS_POLICY); } }
if (convertView == null) { LayoutInflater inflater = (LayoutInflater) (getContext() .getSystemService(Context.LAYOUT_INFLATER_SERVICE)); convertView = inflater.inflate(renderer, null); holder = new ViewHolder(convertView); holder.text = (TextView) convertView.findViewById(R.id.name); holder.textContNo = (TextView) convertView.findViewById(R.id.contactno); holder.textEmailId = (TextView) convertView.findViewById(R.id.emailId); holder.photo = (ImageView ) convertView.findViewById(R.id.quickContactBadge1); convertView.setTag(holder); }else { holder =(ViewHolder) convertView.getTag(); } holder.position = position; Profile contact = listCont.get(position); holder.text.setText(contact.getName()); ImageView photo = (ImageView ) convertView.findViewById(R.id.quickContactBadge1); photo.setTag(contact.getMobileNo()); photo.setImageResource(R.drawable.stub_image);
private void updateUI(){ boolean enableButtons = AccessToken.getCurrentAccessToken() != null; Profile profile = Profile.getCurrentProfile(); if (profile == null) { Log.e("Profile", "null"); } if (enableButtons && profile != null) { Log.e("Access Token",AccessToken.getCurrentAccessToken().toString()); Log.e("TabSocial", profile.getName()); }
AccessToken token = loginResult.getAccessToken(); Profile user = Profile.getCurrentProfile(); String name = user.getName(); Toast.makeText(Login.this, "Connected "+name , Toast.LENGTH_LONG).show();
Profile profile = Profile.getCurrentProfile(); if(null != profile) textView.setText(profile.getName());
Profile profile = Profile.getCurrentProfile(); if(null != profile) { new ProfileTracker() { @Override protected void onCurrentProfileChanged(Profile oldProfile, Profile currentProfile) { if (currentProfile != null) { // handle it stopTracking(); } } }.startTracking(); } else { textView.setText(profile.getName()); }
Profile profile = Profile.getCurrentProfile; String name = profile.getName();
Profile actualProfile = Profile.getCurrentProfile(); String name = actualProfile.getName();
else if (user.isNew()) { Profile profile = Profile.getCurrentProfile(); user.put("gender", ""); user.put("location", ""); user.put("age", ""); user.put("meet", ""); user.put("status", ""); user.put("link", ""); user.put("fullname", profile.getName()); user.setEmail(""); user.signUpInBackground(); ParseInstallation installation = ParseInstallation.getCurrentInstallation(); installation.put("user", user.getObjectId()); installation.put("fullname", user.getString("fullname")); installation.saveInBackground(); openMainActivity(); }
Profile profile; String name; try{ profile = Profile.getCurrentProfile(); name = profile.getName(); }catch(NullPointerException npe){ npe.printStackTrace(); }
XStream stream = new XStream(new StaxDriver()); stream.alias("Profile", Profile.class); stream.aliasAttribute(Profile.class, "dartsThrown", "darts-thrown"); stream.aliasAttribute(Profile.class, "totalScore", "total-scrore"); stream.aliasAttribute(Profile.class, "num100", "s100"); ................ ................. .................. To access these value convert it using fromXML method FileReader fileReader = new FileReader("xmlFile.xml"); Profile profile = (Profile)stream.fromXML(fileReader); System.out.println("Name: "+profile.getName()); .............. ..............
@Override public void onSuccess(LoginResult loginResult) { AccessToken accessToken = AccessToken.getCurrentAccessToken(); Profile profile = Profile.getCurrentProfile(); if(profile != null){ mTextDetails.setText("Welcome " + profile.getName() ); } else { ProfileTracker profileTracker = new ProfileTracker() { @Override protected void onCurrentProfileChanged(Profile oldProfile, Profile currentProfile) { this.stopTracking(); Profile.setCurrentProfile(currentProfile); mTextDetails.setText("Welcome " + currentProfile.getName() ); } }; profileTracker.startTracking(); } }