i created an activity that holds all my activities in a list and declared them in the android manifest. But i keep getting an error "class exception not found". don't know what to do. here is the code and the android manifest.
package com.activityexample.cookbook;
import android.app.ListActivity;
import android.app.SearchManager;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.ListAdapter;
import android.widget.ListView;
public class ExtendsListActivity extends ListActivity implements OnItemClickListener{
static final String[] Possible_Choices = new String[]{
"Open Website Example",
"Open Contacts",
"Open Dialer",
"Search Google Example",
"Start Voice Command"
};
final String searchTerms="supeman";
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setListAdapter(new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,Possible_Choices));
getListView().setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
getListView().setTextFilterEnabled(true);
getListView().setOnItemClickListener(this);
//getListView().setOnItemClickListener(new OnItemClickListener() {
// });
}
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
// TODO Auto-generated method stub
switch (arg2){
case 0:
startActivity(new Intent(Intent.ACTION_VIEW,Uri.parse("http://www.google.com/")));
break;
case 1:
startActivity(new Intent(Intent.ACTION_VIEW,Uri.parse("content://contacts/people/")));
break;
case 2:
startActivity(new Intent(Intent.ACTION_VIEW,Uri.parse("tel://08160212611/")));
break;
case 3:
Intent i = new Intent(Intent.ACTION_WEB_SEARCH);
i.putExtra(SearchManager.QUERY, searchTerms);
startActivity(i);
break;
case 4:
startActivity(new Intent(Intent.ACTION_VOICE_COMMAND));
break;
default: break;
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.activityexample.cookbook"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="18" />
<uses-permission android:maxSdkVersion="19" android:name="android.permission.READ_CONTACTS"/>
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".TheMenu"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".ActivityEx"
android:label="@string/app_name" >
<intent-filter>
<action android:name="com.activityexample.cookbook.ActivityEx" />
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
<activity
android:name=".ExtendsListActivity"
android:label="@string/app_name" >
</activity>
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
</activity>
</application>
</manifest>