Should not call mContext.startActivity() on a mContext (Context) that is not an Activity or Fragment. Made the Context type more specific as Activity everywhere necessary. Also used FLAG_ACTIVITY_NEW_TASK in one place, Preferences, to avoid the possibility of this error. In CustomActionProvider there now are 2 context objects (one needs to be themed). (lp:1331869)