fix: crash on notification events

This commit is contained in:
hyb1996
2017-09-25 16:30:09 +08:00
parent b9f8f9bbd7
commit 7616634e40
7 changed files with 48 additions and 4 deletions

View File

@@ -34,10 +34,12 @@ public interface NotificationListener {
}
public NotificationInfo(CharSequence packageName, List<CharSequence> list) {
mPackageName = packageName.toString();
mPackageName = packageName == null ? "" : packageName.toString();
mTexts = new ArrayList<>(list.size());
for (CharSequence text : list) {
mTexts.add(text.toString());
if (text != null) {
mTexts.add(text.toString());
}
}
if (mTexts.size() > 0) {
mText = mTexts.get(0);