android - how to open menu profile to relayted activity -


this code

textview product1 = new textview(this); product1.setclickable(true); product1.setonclicklistener(new onclicklistener() { @override public void onclick(view v) {      if(v.gettag().tostring().equals("test")){    //toast.maketext(mainactivity.this, "hi", toast.length_long).show();    startactivity(new intent(mainactivity.this, testactivity.class));    } });         

i have tag example profile how open tag want open no of tag using

if(v.gettag().tostring().equals("test")){     ----------- } 

if did'nt wrong. can use switch statement achieve that.

     switch (v.gettag().tostring()) {         case "test":             startactivity(new intent(mainactivity.this, testactivity.class));             break;          case "profile":             startactivity(new intent(mainactivity.this, registeractivity.class));             break;     } 

Comments

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -