Code example for ContentProvider

Methods: attachInfo

0
		} 
		//MockContentResolver 초기화 
		private void init(String authority, Class<P> providerClass) throws Exception{
			mResolver = new MockContentResolver();
			P mProvider = providerClass.newInstance();
			mProvider.attachInfo(this, null);
			assertNotNull(mProvider);
			mResolver.addProvider(authority, mProvider);
		} 
		 
		//MockContext를 이용해 만든 Activity에서 getContentResolver()를 호출 시 이 메소드가 호출됨 
		//MockContentResolver를 반환 
		@Override 
		public ContentResolver getContentResolver(){
			return mResolver;
		} 
	} 
}