This commit is contained in:
ikarulus 2019-01-06 20:37:57 +01:00
parent a79af78796
commit a5c46b4fb4

View file

@ -49,7 +49,7 @@ import static android.Manifest.permission.READ_CONTACTS;
/** /**
* A login screen that offers login via email/password. * A login screen that offers login via email/password.
*/ */
public class LoginActivity extends AppCompatActivity implements LoaderCallbacks<Cursor> { public class LoginActivity extends AppCompatActivity {
/** /**
* Keep track of the login task to ensure we can cancel it if requested. * Keep track of the login task to ensure we can cancel it if requested.
@ -182,43 +182,6 @@ public class LoginActivity extends AppCompatActivity implements LoaderCallbacks<
} }
} }
@Override
public Loader<Cursor> onCreateLoader(int i, Bundle bundle) {
return new CursorLoader(this,
// Retrieve data rows for the device user's 'profile' contact.
Uri.withAppendedPath(ContactsContract.Profile.CONTENT_URI,
ContactsContract.Contacts.Data.CONTENT_DIRECTORY), ProfileQuery.PROJECTION,
// Select only email addresses.
ContactsContract.Contacts.Data.MIMETYPE +
" = ?", new String[]{ContactsContract.CommonDataKinds.Email
.CONTENT_ITEM_TYPE},
// Show primary email addresses first. Note that there won't be
// a primary email address if the user hasn't specified one.
ContactsContract.Contacts.Data.IS_PRIMARY + " DESC");
}
@Override
public void onLoadFinished(Loader<Cursor> loader, Cursor data) {
}
@Override
public void onLoaderReset(Loader<Cursor> cursorLoader) {
}
private interface ProfileQuery {
String[] PROJECTION = {
ContactsContract.CommonDataKinds.Email.ADDRESS,
ContactsContract.CommonDataKinds.Email.IS_PRIMARY,
};
int ADDRESS = 0;
int IS_PRIMARY = 1;
}
/** /**
* Represents an asynchronous login/registration task used to authenticate * Represents an asynchronous login/registration task used to authenticate
* the user. * the user.
@ -298,7 +261,7 @@ public class LoginActivity extends AppCompatActivity implements LoaderCallbacks<
connection.disconnect(); connection.disconnect();
} }
} }
return true; return success;
} }
@Override @Override