private boolean mStatusCorrect, mIsSslConn;\r
private RemoteOperationResult mLastSslUntrustedServerResult;\r
\r
+ public static final String PARAM_ACCOUNTNAME = "param_Accountname";\r
+ \r
public static final String PARAM_USERNAME = "param_Username";\r
public static final String PARAM_HOSTNAME = "param_Hostname";\r
\r
mStatusText = mStatusIcon = 0;\r
mStatusCorrect = false;\r
mIsSslConn = false;\r
+ \r
+ String accountName = getIntent().getExtras().getString(PARAM_ACCOUNTNAME);\r
+ String tokenType = getIntent().getExtras().getString(AccountAuthenticator.KEY_AUTH_TOKEN_TYPE);\r
+ if (AccountAuthenticator.AUTH_TOKEN_TYPE_ACCESS_TOKEN.equals(tokenType)) {\r
+ CheckBox oAuth2Check = (CheckBox) findViewById(R.id.oauth_onOff_check);\r
+ oAuth2Check.setChecked(true);\r
+ changeViewByOAuth2Check(true);\r
+ } \r
+ \r
+ if (accountName != null) {\r
+ ((TextView) findViewById(R.id.account_username)).setText(accountName.substring(0, accountName.lastIndexOf('@')));\r
+ tv.setText(accountName.substring(accountName.lastIndexOf('@') + 1));\r
+ }\r
}\r
iv.setOnClickListener(this);\r
iv2.setOnClickListener(this);\r
if (v.getId() == R.id.refreshButton) {\r
onFocusChange(findViewById(R.id.host_URL), false);\r
} else if (v.getId() == R.id.viewPassword) {\r
- TextView view = (TextView) findViewById(R.id.account_password);\r
+ EditText view = (EditText) findViewById(R.id.account_password);\r
+ int selectionStart = view.getSelectionStart();\r
+ int selectionEnd = view.getSelectionEnd();\r
int input_type = view.getInputType();\r
if ((input_type & InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD) == InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD) {\r
input_type = InputType.TYPE_CLASS_TEXT\r
| InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD;\r
}\r
view.setInputType(input_type);\r
+ view.setSelection(selectionStart, selectionEnd);\r
}\r
}\r
\r