From 8a342a3cc07162cdb5458692f04fbc677802919e Mon Sep 17 00:00:00 2001 From: Romain Guy Date: Thu, 30 Apr 2009 15:31:41 -0700 Subject: [PATCH] Fix typo in exception message and add a new exception if the user tries to use the same child as both the handle and content for the SlidingDrawer. --- core/java/android/widget/SlidingDrawer.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/java/android/widget/SlidingDrawer.java b/core/java/android/widget/SlidingDrawer.java index e0f1bb41ce892..92561edc1cd11 100644 --- a/core/java/android/widget/SlidingDrawer.java +++ b/core/java/android/widget/SlidingDrawer.java @@ -206,10 +206,15 @@ public class SlidingDrawer extends ViewGroup { int contentId = a.getResourceId(R.styleable.SlidingDrawer_content, 0); if (contentId == 0) { - throw new IllegalArgumentException("The handle attribute is required and must refer " + throw new IllegalArgumentException("The content attribute is required and must refer " + "to a valid child."); } + if (handleId == contentId) { + throw new IllegalArgumentException("The content and handle attributes must refer " + + "to different children."); + } + mHandleId = handleId; mContentId = contentId;