android - Button Stays on Screen between Activities -


in android application i'm writing have button when pressed transitions new activity using intents. new activity has linearlayout, framelayout inside of it. when reach new activity button previous activity still on screen , still can tapped; however, causes application crash because onclick method isn't defined in new activity.

any idea why button remains? ideally i'd remove button.

edit, adding code:

intent intent = new intent(mainactivity.this, cameraactivity.class);             startactivity(intent);             finish(); 

could please show code? easier see, anywho try using this:

public void onclick(view v) { switch(v.getid()){      case r.id.bsubmit:                 if (a > 0 && b > 0 && c > 0 && d > 0){                 bundle basket = new bundle();                 basket.put***("key"); //depening on trying transfer 1 class other, different.                 intent = new intent(main.this, other.class);                 i.putextras(basket);                 startactivity(i);                 finish(); break; 

that should on activity trying send from. btw using intent works, bundle(s) preferd far know.

also retrive go on other.java , write this: (inside oncreate)

bundle basket = getintent().getextras();         = basket.get***("key") 

Comments

Popular posts from this blog

php - render data via PDO::FETCH_FUNC vs loop -

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

The canvas has been tainted by cross-origin data in chrome only -