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

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

python - How do I create a list index that loops through integers in another list -

c# - “System.Security.Cryptography.CryptographicException: Keyset does not exist” when reading private key from remote machine -