I\'m trying to take a screenshot of my Android application using Robotium, I\'m using the below function that I found here.
public static String SCREEN_SHOTS
The reason why you are getting NullPointerException is because you are using getView(int id) incorrectly. As you are giving it an index instead of id, it will not find the view that you are looking for and thus returns null. What you want to use is following:
takeScreenShot(solo.getViews().get(0), "Test")
Which means the first view of all the views available to Robotium at a given time.