Code example for Context

Methods: getApplicationContext

0
import java.util.ArrayList; 
import java.util.List; 
 
class ContactIdentityManagerGingerbread extends ContactIdentityManager { 
 
  public ContactIdentityManagerGingerbread(Context context) {
    super(context);
  } 
 
  @Override 
  public Uri getSelfIdentityUri() {
    SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
    String contactUriString       = preferences.getString(ApplicationPreferencesActivity.IDENTITY_PREF, null);
 
    if (hasLocalNumber()) { 
      return getContactUriForNumber(getLocalNumber()); 
    } else if (contactUriString != null) {
      return Uri.parse(contactUriString);
    } 
 
    return null;