catch exception of IntentGenerator.getTitle(...)
This commit is contained in:
@ -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");
|
||||
}
|
||||
|
Reference in New Issue
Block a user