Skip to content

Commit

Permalink
attempt to fix context in preferences
Browse files Browse the repository at this point in the history
  • Loading branch information
wbrunette committed Sep 16, 2019
1 parent da70cf9 commit b98385a
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ public class DefaultViewTypePreference extends ListPreference {
*/
public DefaultViewTypePreference(Context context, AttributeSet attrs) {
super(context, attrs);
mContext = ((ContextThemeWrapper) context).getBaseContext();
if (mContext instanceof IAppAwareActivity) {
mAppName = ((IAppAwareActivity) mContext).getAppName();
if (context instanceof IAppAwareActivity) {
mContext = context;
mAppName = ((IAppAwareActivity) context).getAppName();
} else {
throw new IllegalArgumentException("Must be in an activity that knows the app name");
}
Expand Down

0 comments on commit b98385a

Please sign in to comment.