MCPcopy Create free account
hub / github.com/Odoo-mobile/framework / init

Method init

src/com/odoo/MainActivity.java:155–183  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

153 }
154
155 private void init() {
156 Log.d(TAG, "MainActivity->init()");
157 initDrawerControls();
158 boolean reqForNewAccount = getIntent().getBooleanExtra(
159 "create_new_account", false);
160 /**
161 * checks for available account related to Odoo
162 */
163 if (!OdooAccountManager.hasAccounts(this) || reqForNewAccount) {
164 getActionBar().setDisplayHomeAsUpEnabled(false);
165 getActionBar().setHomeButtonEnabled(false);
166 lockDrawer(true);
167 AccountFragment account = new AccountFragment();
168 startMainFragment(account, false);
169 } else {
170 lockDrawer(false);
171 /**
172 * User found but not logged in. Requesting for login with available
173 * accounts.
174 */
175 if (!OdooAccountManager.isAnyUser(mContext)) {
176 accountSelectionDialog(
177 OdooAccountManager.fetchAllAccounts(mContext)).show();
178 } else {
179 initDrawer();
180 }
181 }
182 checkForRateApplication();
183 }
184
185 protected void initTouchListener() {
186 OETouchListener.DEFAULT_HEADER_LAYOUT = R.layout.default_header;

Callers 3

onTaskDoneMethod · 0.95
onClickMethod · 0.95
restartMethod · 0.95

Calls 9

initDrawerControlsMethod · 0.95
hasAccountsMethod · 0.95
lockDrawerMethod · 0.95
startMainFragmentMethod · 0.95
isAnyUserMethod · 0.95
fetchAllAccountsMethod · 0.95
initDrawerMethod · 0.95

Tested by

no test coverage detected