How can I set an intent's class from a string value?
Posted
by twaxwei
on Stack Overflow
See other posts from Stack Overflow
or by twaxwei
Published on 2010-06-10T21:16:10Z
Indexed on
2010/06/10
21:42 UTC
Read the original article
Hit count: 130
I am trying to set the class for an intent to the address listed in a string value, so that I can launch a given activity. The string is composed dynamically during runtime.
Is there anyway to make something like the code below run:
String target=com.test.activity1.class;
Intent intent=new intent();
intent.setClass(this, target);
Thanks
© Stack Overflow or respective owner