I am using a single switch cases which will have more than 100 cases statement to be used. Are there any limit ?
The usage of cases are for the suggestions of my Aut
I don't know exactly what your startActivity()
method do, don't even know how the Intent
object is implemented, but I think an alternative way to solve your issue could be:
Shop
(for example);Adidas
or Affin
from it;startActivity()
method for each class;For example:
public interface Shop
{
void startActivity(Intent i);
}
Then, for each class...
public class Adidas implements Shop
{
public Adidas(){
// ...
}
public void startActivity(Intent i)
{
// specific implementation
}
}
Finally, in your client code
Shop[] shops = new Shop[]{ new Adidas(), new Affin(), ... };
for (Shop shop : shops)
{
shop.startActivity(new Intent(Search.this));
}