Skip to content

Instantly share code, notes, and snippets.

@mohak1712
Created June 18, 2018 11:40
Show Gist options
  • Save mohak1712/60fe41e32b31149f67c9ab13a813d61e to your computer and use it in GitHub Desktop.
Save mohak1712/60fe41e32b31149f67c9ab13a813d61e to your computer and use it in GitHub Desktop.
public class MockRunner extends AndroidJUnitRunner {
@Override
public void onCreate(Bundle arguments) {
StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder().permitAll().build());
super.onCreate(arguments);
}
@Override
public Application newApplication(ClassLoader cl, String className, Context context)
throws InstantiationException, IllegalAccessException, ClassNotFoundException {
return super.newApplication(cl, UiTestApp.class.getName(), context);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment