Android : Activity does not respond

on Sunday, November 2, 2014


I have an activity which wont respond. The name of the activity is Comedyactionactivity.


Here is the code and below the manifest file:



public class ComedyActivity extends ActionBarActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.comedy);
pupulateListView();
registerClickCallback();
}

private void registerClickCallback() {
ListView list = (ListView)findViewById(R.id.listViewComedySubgenres);

list.setOnItemClickListener(new AdapterView.OnItemClickListener() {

@Override
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {

Intent intent;
switch(position)
{
case 0:
intent = new Intent(ComedyActivity.this,Comedyactionactivity.class);
startActivity(intent);
break;
case 1:
intent = new Intent(ComedyActivity.this,ComedycomedyActivity.class);
startActivity(intent);
break;
case 2:
intent = new Intent(ComedyActivity.this,ComedydramaActivity.class);
startActivity(intent);
break;
case 3:
intent = new Intent(ComedyActivity.this,ComedyromanceActivity.class);
startActivity(intent);
break;
default:
break;
}

}
});

}

private void pupulateListView() {
String[] myItems = {"Action","Komedi","Drama","Romantik"};
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,R.layout.the_list,myItems);
ListView list = (ListView)findViewById(R.id.listViewComedySubgenres);
list.setAdapter(adapter);

}

}


Manifest file:



<activity
android:name="comedygenres.ComedyromanceActivity"
android:label="@string/title_activity_comedyromance" >
</activity>
<activity
android:name="comedygenres.ComedydramaActivity"
android:label="@string/title_activity_comedydrama" >
</activity>
<activity
android:name="comedygenres.Comedyactionactivity"
android:label="@string/title_activity_comedyaction" >
</activity>
<activity
android:name="comedygenres.ComedycomedyActivity"
android:label="@string/title_activity_comedycomedy" >
</activity>


The activity declarations are correct spelled and i have identic code in the java file which works perfect, but this one doesn't. Any idea why this activity wont respond ?


The error i receive is :


android.content.ActivityNotFoundException: Unable to find explicit activity class {com.example.its_time/com.example.its_time.comedygenres.Comedyactionactivity}; have you declared this activity in your AndroidManifest.xml?


0 comments:

Post a Comment