Code example for AccountManager

Methods: addAccountExplicitly

0
 
	@Override 
	protected void tearDown() throws Exception{ 
 
		// When we tear down, we want to replace the username and pass 
		am.addAccountExplicitly(oldAccount, oldPassword, null);
 
		try { 
			solo.finalize();
		} catch (Throwable e) { 
			e.printStackTrace();
		} 
		getActivity().finish();  
		super.tearDown(); 
	} 
 
	public void testInitialLogin() { 
		if(SharedPreferencesHelper.PASSWORD == null || (SharedPreferencesHelper.USERNAME == null && oldAccount.name == null))
			throw new RuntimeException("The username and password constants must be set in order to log in");
 
		solo.enterText(0, (SharedPreferencesHelper.USERNAME == null) ? oldAccount.name : SharedPreferencesHelper.USERNAME);