I have to start a activity class , i know how to start an activity but the problem is that my class name is dynamic. I mean we have 5 activity named 1. Events 2. Notification 3. Chat 4. Message 5. Settings
we also have to show this above name in TabWidget but the order of his name is coming from server . Hence sometime server return Events at first index, sometimes notification is at first index. order can be changed dynamically and it may return two or three of them and according to that we have to show the TabWidget.
its means if the server returning array with two string then we have only two tab if it return three then we have three tab.
currently I am using this method to add tab dynamically
private void setTabDynimacaaly() {
String NameOfClass;
for (int i = 0; i < menuListArray.size(); i++) {
NameOfClass = menuListArray.get(i).get(4).toString().trim();
intent = new Intent().setClassName("com.mcm.menuandnotification",
"com.mcm.menuandnotification" + NameOfClass);
spec = tabHost.newTabSpec(NameOfClass).setIndicator("")
.setContent(intent);
// Add intent to tab
tabHost.addTab(spec);
}
}
my menuListArray has datalike this
06-02 07:18:06.732: E/MY APP MENU DATA(19739): [[38, 206, 5, MyChurchMateApp, Events, 1, \Images\MyChurchMateApp\ThemeImages\], [38, 206, 4, MyChurchMateApp, Notifications, 5, \Images\MyChurchMateApp\ThemeImages\], [38, 206, 7, MyChurchMateApp, Settings, 100, \Images\MyChurchMateApp\ThemeImages\]]
and in manifest i have declared all the activity
<activity
android:name=".menuandnotification.TabBar"
android:screenOrientation="portrait" >
</activity>
<activity
android:name=".menuandnotification.Events"
android:screenOrientation="portrait" >
</activity>
<activity
android:name=".menuandnotification.Notifications"
android:screenOrientation="portrait" >
</activity>
<activity
android:name=".menuandnotification.Message"
android:screenOrientation="portrait" >
</activity>
<activity
android:name=".menuandnotification.Chat"
android:screenOrientation="portrait" >
</activity>
<activity
android:name=".menuandnotification.Settings"
android:screenOrientation="portrait" >
</activity>
but it is getting crashed and my error logcat is
06-02 07:18:07.662: E/AndroidRuntime(19739): java.lang.RuntimeException: Unable to
start activity ComponentInfo{com.mcm/com.mcm.menuandnotification.TabBar}:
android.content.ActivityNotFoundException: Unable to find explicit activity class
{com.mcm.menuandnotification/com.mcm.menuandnotificationEvents}; have you declared
this activity in your AndroidManifest.xml?