1, 概述
RequestSync是同步的意思,主要是和ContentResolver进行交互,同步数据库信息。
2, RequestSync详细流程
RequestSync的main方法如下,
public static void main(String[] args) {
try {
(new RequestSync()).run(args);
} catch (IllegalArgumentException e) {
showUsage();
System.err.println("Error: " + e);
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace(System.err);
System.exit(1);
}
}
直接调用run方法,方法如下,
private void run(String[] args) throws Exception {
mArgs = args;
mNextArg = 0;
final boolean ok = parseArgs();
if (ok) {
final Account account = mAccountName != null && mAccountType != null
? new Account(mAccountName, mAccountType) : null;
System.out