Android: How to test a custom view?
问题 There are several methods of unit testing in Android, what's the best one for testing a custom view I've written? I'm currently testing it as part of my activity in an instrumentation test case, but I'd rather test just the view, isolated. 回答1: Well unit testing is a method by which individual units of source code are tested to determine if they are fit for use. So when you say you want to test your custom view, you can check various methods of your custom views like "onTouchEvent", "onDown",