catch exception of IntentGenerator.getTitle(...)

This commit is contained in:
Philipp Schaefer
2014-02-23 12:47:16 +01:00
parent b642ec2299
commit 58c68edb81
4 changed files with 14 additions and 14 deletions

View File

@ -34,9 +34,8 @@ public class IntentGenerator {
}
}
public static String getTitle(final Intent intent) {
if (intent.hasExtra(EXTRA_FLAG_TITLE))
return intent.getStringExtra(EXTRA_FLAG_TITLE);
public static String getTitle(final Intent intent) throws IllegalArgumentException {
if (intent.hasExtra(EXTRA_FLAG_TITLE)) return intent.getStringExtra(EXTRA_FLAG_TITLE);
throw new IllegalArgumentException("Got an intent not generated by IntentGenerator");
}