Instead of this
in intent constructor pass <YourActivityName>.this
:
Intent intent = new Intent(MainActivity.this, TasksTabLayoutActivity.class);
Inside onclicklistener
if you use this
it refers to the onclicklistener
class object not the context and the first argument in Intent
constructor is expecting an context
to be passed.
You need to supply your activity
object in this argument(Activity extends context).