Go Back   Android Forums > Android Development > Application Development
Application Development Dev lounge for our application developers.

New Forums: Nexus Player | Nexus 9
test: Reply
 
LinkBack Thread Tools
Old September 23rd, 2012, 03:20 AM   #1 (permalink)
New Member
Thread Author (OP)
 
Join Date: Sep 2012
Posts: 3
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default Android - Open new Activity from extends framelayout

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.

Advertisements
simple80 is offline  
Reply With Quote
sponsored links
Old September 24th, 2012, 11:28 AM   #2 (permalink)
Senior Member
 
jonbonazza's Avatar
 
Join Date: Jul 2010
Gender: Male
Posts: 1,935
 
Device(s): Nexus 4, Samsung Galaxy S II, HTC Evo 4G, Amazon Kindle Fire
Carrier: ATT

Thanks: 235
Thanked 482 Times in 294 Posts
Default

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

Should be:

Code:
Intent myIntentopen = new Intent(MainActivityold.this, MainActivitynew.class);
startActivity(myIntentopen);
jonbonazza is offline  
Reply With Quote
Old September 25th, 2012, 11:57 AM   #3 (permalink)
New Member
Thread Author (OP)
 
Join Date: Sep 2012
Posts: 3
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by jonbonazza View Post
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.
simple80 is offline  
Reply With Quote
Reply


Go Back   Android Forums > Android Development > Application Development
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 05:44 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.