Alex Rivera | Logout

How to start one activity from Customized View

Asked 2011-03-05T09:52:33.827
13

How to start one activity from another View (another activity View)

For example,

public class CorrectSmoothGloflo extends Activity {
  .......................
  setContentView(new Panel(this));
}


public class Panel extends View {

   //This view class contains some drawable operation
   // Here i want to start another Activity like this

   Intent i=new Intent(CorrectSmoothGloflo.this,Screen.class);
    startActivity(i);   
}

I cant do this operation. Because this is the View, that will not work, because View does not have startActivity(). How to implement this? please give some guidelines.

Edit
Report

1 Answer

1

Setup an event handler to your "another activity View", and put the activity calling statements in it.

answered 2011-03-05T10:51:06.287

Your Answer