- Getting ActivityNotFoundException even though it should exist
- <uses-sdk android:minSdkVersion="7" />
- <application
- android:icon="@drawable/ic_launcher"
- android:label="@string/app_name" >
- <activity
- android:name=".ListsActivity"
- android:label="@string/app_name"
- android:theme="@android:style/Theme.NoTitleBar">
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
- <category android:name="android.intent.category.LAUNCHER" />
- </intent-filter>
- </activity>
- <activity android:name=".ListActivity" ></activity>
- </application>
- package org.softnux.android.lists;
- import android.app.Activity;
- import android.app.ListActivity;
- import android.content.Intent;
- import android.os.Bundle;
- import android.view.View;
- import android.widget.Button;
- public class ListsActivity extends Activity
- {
- @Override
- public void onCreate(Bundle savedInstanceState)
- {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.lists);
- Button intentTestButton = (Button) findViewById(R.id.intentTestButton);
- intentTestButton.setOnClickListener(new Button.OnClickListener()
- {
- public void onClick(View v)
- {
- Intent showListViewIntent = new Intent(ListsActivity.this,
- ListActivity.class);
- startActivity(showListViewIntent);
- }
- });
- }
- }
- package org.softnux.android.lists;
- import android.app.Activity;
- import android.os.Bundle;
- public class ListActivity extends Activity
- {
- @Override
- public void onCreate(Bundle savedInstanceState)
- {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.list);
- }
- }
- Intent showListViewIntent = new Intent(ListsActivity.this, ListActivity.class);
- startActivity(showListViewIntent);
- import android.app.ListActivity;