1. Introducing Channels - a new way to chat with other Android users!
    Dismiss Notice

Android - Open new Activity from extends framelayout


Last Updated:

  1. simple80

    simple80 New Member This Topic's Starter

    Joined:
    Sep 23, 2012
    Messages:
    3
    Likes Received:
    0
    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.
     

    Advertisement
  2. jonbonazza

    jonbonazza Well-Known Member

    Joined:
    Jul 13, 2010
    Messages:
    1,934
    Likes Received:
    458
    That's because you are Initializing your Intent object incorrectly.

    Should be:

    Code (Text):
    1.  
    2. Intent myIntentopen = new Intent(MainActivityold.this, MainActivitynew.class);
    3. startActivity(myIntentopen);
    4.  
     
  3. simple80

    simple80 New Member This Topic's Starter

    Joined:
    Sep 23, 2012
    Messages:
    3
    Likes Received:
    0

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

    thanks for your answer.
     

Share This Page

Loading...