• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Android - Open new Activity from extends framelayout

simple80

Lurker
Hello,

I'm doing that sample:

http://code.google.com/p/proyectouvipool/source/browse/trunk/Android/PFC/src/pablo/developer/BalloonOverlayView.java?r=87

I want to change at this line

public void onClick(View v) {layout.setVisibility(GONE);}

to

public void onClick(View v) {

Intent myIntentopen = new Intent(MainActivityold.class, MainActivitynew.class);
startActivity(myIntentopen);

}

but it dosn't work.

thanks.
 
That's because you are Initializing your Intent object incorrectly.

Should be:

Code:
Intent myIntentopen = new Intent(MainActivityold.this, MainActivitynew.class);
startActivity(myIntentopen);
 
That's because you are Initializing your Intent object incorrectly.

Should be:

Code:
Intent myIntentopen = new Intent(MainActivityold.this, MainActivitynew.class);
startActivity(myIntentopen);


it must be getContext().startActivity(intent);

thanks for your answer.
 
Back
Top Bottom