fix RuntimeException when inflating default layout for AdapterView-based widgets
Bug: 151901506 Test: manual Change-Id: I71068b7d13783f658c02cc76ec50f40319e68160
This commit is contained in:
@@ -625,7 +625,10 @@ public class AppWidgetHostView extends FrameLayout {
|
||||
}
|
||||
}
|
||||
defaultView = inflater.inflate(layoutId, this, false);
|
||||
defaultView.setOnClickListener(this::onDefaultViewClicked);
|
||||
if (!(defaultView instanceof AdapterView)) {
|
||||
// AdapterView does not support onClickListener
|
||||
defaultView.setOnClickListener(this::onDefaultViewClicked);
|
||||
}
|
||||
} else {
|
||||
Log.w(TAG, "can't inflate defaultView because mInfo is missing");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user