本文整理汇总了Java中android.accounts.IAccountManagerResponse.onResult方法的典型用法代码示例。如果您正苦于以下问题:Java IAccountManagerResponse.onResult方法的具体用法?Java IAccountManagerResponse.onResult怎么用?Java IAccountManagerResponse.onResult使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.accounts.IAccountManagerResponse
的用法示例。
在下文中一共展示了IAccountManagerResponse.onResult方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: sendResult
import android.accounts.IAccountManagerResponse; //导入方法依赖的package包/类
public void sendResult() {
IAccountManagerResponse response = getResponseAndClose();
if (response != null) {
try {
Account[] accounts = new Account[mAccountsWithFeatures.size()];
for (int i = 0; i < accounts.length; i++) {
accounts[i] = mAccountsWithFeatures.get(i);
}
if (Log.isLoggable(TAG, Log.VERBOSE)) {
Log.v(TAG, getClass().getSimpleName() + " calling onResult() on response "
+ response);
}
Bundle result = new Bundle();
result.putParcelableArray(AccountManager.KEY_ACCOUNTS, accounts);
response.onResult(result);
} catch (RemoteException e) {
// if the caller is dead then there is no one to care about remote exceptions
Log.v(TAG, "failure while notifying response", e);
}
}
}
示例2: sendResult
import android.accounts.IAccountManagerResponse; //导入方法依赖的package包/类
public void sendResult() {
IAccountManagerResponse response = getResponseAndClose();
if (response != null) {
try {
Account[] accounts = new Account[mAccountsWithFeatures.size()];
for (int i = 0; i < accounts.length; i++) {
accounts[i] = mAccountsWithFeatures.get(i);
}
if (Log.isLoggable(TAG, Log.VERBOSE)) {
Log.v(TAG, getClass().getSimpleName() + " calling onResult() on response "
+ response);
}
Bundle result = new Bundle();
result.putParcelableArray(AccountManager.KEY_ACCOUNTS, accounts);
response.onResult(result);
} catch (RemoteException e) {
// if the caller is dead then there is no one to care about remote exceptions
Log.v(TAG, "failure while notifying response", e);
}
}
}
示例3: renameAccount
import android.accounts.IAccountManagerResponse; //导入方法依赖的package包/类
@Override
public void renameAccount(int userId, IAccountManagerResponse response, Account accountToRename, String newName) {
if (accountToRename == null) throw new IllegalArgumentException("account is null");
Account resultingAccount = renameAccountInternal(userId, accountToRename, newName);
Bundle result = new Bundle();
result.putString(AccountManager.KEY_ACCOUNT_NAME, resultingAccount.name);
result.putString(AccountManager.KEY_ACCOUNT_TYPE, resultingAccount.type);
try {
response.onResult(result);
} catch (RemoteException e) {
Log.w(TAG, e.getMessage());
}
}
示例4: onResult
import android.accounts.IAccountManagerResponse; //导入方法依赖的package包/类
private void onResult(IAccountManagerResponse response, Bundle result) {
try {
response.onResult(result);
} catch (RemoteException e) {
// if the caller is dead then there is no one to care about remote
// exceptions
e.printStackTrace();
}
}
示例5: renameAccount
import android.accounts.IAccountManagerResponse; //导入方法依赖的package包/类
@Override
public void renameAccount(int userId, IAccountManagerResponse response, Account accountToRename, String newName) {
if (accountToRename == null) throw new IllegalArgumentException("account is null");
Account resultingAccount = renameAccountInternal(userId, accountToRename, newName);
Bundle result = new Bundle();
result.putString(AccountManager.KEY_ACCOUNT_NAME, resultingAccount.name);
result.putString(AccountManager.KEY_ACCOUNT_TYPE, resultingAccount.type);
try {
response.onResult(result);
} catch (RemoteException e) {
Log.w(TAG, e.getMessage());
}
}
示例6: onResult
import android.accounts.IAccountManagerResponse; //导入方法依赖的package包/类
private void onResult(IAccountManagerResponse response, Bundle result) {
try {
response.onResult(result);
} catch (RemoteException e) {
// if the caller is dead then there is no one to care about remote
// exceptions
e.printStackTrace();
}
}