Inside your LinearLayout
extending class, you could create the following method:
public void launch() {
Intent i = new Intent(getContext(), YourActivity.class);
getContext().startActivity(i);
}
Use the getContext()
method inside your customview to retrieve the Context
and start a new Activity
.