I am trying to run Activity which extends TabActivity from a class which extends Activity.
Intent intent = new Intent(this, TasksTabLayoutActivity.class);
startActivity(intent);
This is my TabActivity class definition:
public class TasksTabLayoutActivity extends TabActivity
But this obviously wont compile.
I know TabActivity is deprecated but in this case i need to use it.
How can i start TabActivity from my activity?
Instead of
thisin intent constructor pass<YourActivityName>.this:Inside
onclicklistenerif you usethisit refers to theonclicklistenerclass object not the context and the first argument inIntentconstructor is expecting ancontextto be passed.You need to supply your
activityobject in this argument(Activity extends context).