Skip to content

Instantly share code, notes, and snippets.

@daneko
Created January 25, 2012 05:25
Show Gist options
  • Save daneko/1674899 to your computer and use it in GitHub Desktop.
Save daneko/1674899 to your computer and use it in GitHub Desktop.
Android AndroidTestCaseからTestプロジェクトのコンテキスト取得方法
// https://github.com/ussy/sqlite-fixture 参考
// @hideなので以下のようになる
Context getTestprojectContext( AndroidTestCase testProject){
Method method = testProject.getClass().getMethod("getTestContext", new Class[0]);
return ((Context) method.invoke(testProject, new Object[0]));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment