Got  a solution..

private Class<?> c = null;
c=  Class.forName(packagename+classname);
intent = new Intent(this,c);
startActivity(intent);

it works fine.

On Sat, Jul 23, 2011 at 4:45 AM, Goutom <[email protected]> wrote:

> I tried this:
> String str = getMyString();
> Intent intent = new Intent(this,Class.forName(str));
> startActivity(intent);
>
> but failed..
>
> Any help will be appriciatable...
>
> Regards
> Goutom
>
>
> On Sat, Jul 23, 2011 at 3:34 AM, Goutom <[email protected]> wrote:
>
>> Hi All
>>
>> I have following problems,
>>
>> String str;
>> str =getMyString();
>>
>> //"str" is my calss name.
>>
>> // I want to build a intent using this string as class name(?).
>>
>> Intent intent = new Intent(this, ? );
>>
>> startActivity(intent);
>>
>> Thanks in advance.
>>
>> Regards
>> Goutom
>>
>>
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to