내 검색어를 기록하는 것은 잘못된 장소 일 수 있지만 긴급합니다. 누구든지 "계정 및 동기화"에서 Google 계정을 삭제하는 방법을 알려주세요. 이 줄을 내 응용 프로그램이라고 부르겠습니다. AccountManagerService.getSingleton(). onServiceChanged (null, true);안드로이드 : 데이터베이스에서 계정을 삭제하는 방법 내 응용 프로그램에서 "계정 및 동기화"아래에 표시되는
반면 OnServiceChanged() 메서드는 AccountManagerService.java에 정의되어 있습니다.
============================================== =================
public void onServiceChanged(AuthenticatorDescription desc, boolean removed) {
boolean accountDeleted = false;
SQLiteDatabase db = mOpenHelper.getWritableDatabase();
Cursor cursor = db.query(TABLE_ACCOUNTS,
new String[]{ACCOUNTS_ID, ACCOUNTS_TYPE, ACCOUNTS_NAME},
ACCOUNTS_TYPE + "=?", new String[]{desc.type}, null, null, null);
try {
while (cursor.moveToNext()) {
final long accountId = cursor.getLong(0);
final String accountType = cursor.getString(1);
final String accountName = cursor.getString(2);
Log.d(TAG, "deleting account " + accountName + " because type "
+ accountType + " no longer has a registered authenticator");
db.delete(TABLE_ACCOUNTS, ACCOUNTS_ID + "=" + accountId, null);
accountDeleted = true;
}
} finally {
cursor.close();
if (accountDeleted) {
sendAccountsChangedBroadcast();
}
}
============ ========================================================================================================== =============== 코드의
이 작품은 아무것도하지 않는 난 하위 계층에서 처리되는 예외가 발생 bieng 느낄.