tags:

views:

669

answers:

1

Given

Android.xml:

<activity android:name='.IconListActivity'
  android:label='@string/icon_list_activity_name'
/>

Strings.xml:

<string name='icon_list_activity_name>Icon List</string>

How do I access to the string 'Icon List' given IconListActivity.class?

+2  A: 

PackageManager#getActivityInfo() returns an ActivityInfo structure, which has a labelRes and a name field, one of which should have what you need.

CommonsWare
Perfect! Exactly what I needed. Thanks!
Scott