unable to handle CheckData button on my emulator
<p>when i was clicking CheckData button on my emulator its showing a </p>

<pre><code>&gt; error:  android.content.ActivityNotFoundException: Unable to find
&gt; explicit activity class {app.login/app.login.DatabaseSample}; have you
&gt; declared this activity in your AndroidManifest.xml?
</code></pre>

<p>but i have declared in android mnaifest.xml as  </p>

<pre><code> package="app.login"&lt;application
        android:icon="@drawable/ic_launcher"        android:label="@string/app_name" &gt;
        &lt;activity
            android:label="@string/app_name"            android:name=".LoginappActivity" &gt;
            &lt;intent-filter &gt;
                &lt;action android:name="android.intent.action.MAIN" /&gt;
                &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
            &lt;/intent-filter&gt;
        &lt;/activity&gt;

        &lt;activity android:name=".SaveData"&gt; &lt;/activity&gt;
        &lt;activity android:name=".CheckData"&gt;&lt;/activity&gt;
        &lt;activity android:name=".DatabaseSample"&gt; &lt;/activity&gt;

    &lt;/application&gt;
</code></pre>

<p>this is my CheckData.java file</p>

<pre><code>public class CheckData extends ListActivity  {     
    TextView selection;
    public int idToModify; 
    DataManipulator dm;

    List&lt;String[]&gt; names1 =null ;
    String[] stg1;
    protected void onCreate(Bundle savedInstanceState){
        super.onCreate(savedInstanceState);
        setContentView(R.layout.check);
          dm = new DataManipulator(this);
          names1 = dm.selectAll();

        stg1=new String[names1.size()]; 

        String stg;

        for (String[] name : names1) {stg = name[1];
        }

        ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(   
                this,android.R.layout.simple_list_item_1,stg1);
        this.setListAdapter(adapter);
        selection=(TextView)findViewById(R.id.selection);

    }      

    public void onListItemClick(ListView parent, View v, int position, long id) {
        selection.setText(stg1[position]);
    }
}
</code></pre>

<p>Logcat is</p>

<pre><code>05-10 12:42:03.292: E/AndroidRuntime(606): FATAL EXCEPTION: main
05-10 12:42:03.292: E/AndroidRuntime(606): java.lang.RuntimeException: Unable to start activity ComponentInfo{app.login/app.login.DatabaseSample}: java.lang.NullPointerException
05-10 12:42:03.292: E/AndroidRuntime(606):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956)
05-10 12:42:03.292: E/AndroidRuntime(606):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
05-10 12:42:03.292: E/AndroidRuntime(606):  at android.app.ActivityThread.access$600(ActivityThread.java:123)
05-10 12:42:03.292: E/AndroidRuntime(606):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
05-10 12:42:03.292: E/AndroidRuntime(606):  at android.os.Handler.dispatchMessage(Handler.java:99)
05-10 12:42:03.292: E/AndroidRuntime(606):  at android.os.Looper.loop(Looper.java:137)
05-10 12:42:03.292: E/AndroidRuntime(606):  at android.app.ActivityThread.main(ActivityThread.java:4424)
05-10 12:42:03.292: E/AndroidRuntime(606):  at java.lang.reflect.Method.invokeNative(Native Method)
05-10 12:42:03.292: E/AndroidRuntime(606):  at java.lang.reflect.Method.invoke(Method.java:511)
05-10 12:42:03.292: E/AndroidRuntime(606):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
05-10 12:42:03.292: E/AndroidRuntime(606):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
05-10 12:42:03.292: E/AndroidRuntime(606):  at dalvik.system.NativeStart.main(Native Method)
05-10 12:42:03.292: E/AndroidRuntime(606): Caused by: java.lang.NullPointerException
05-10 12:42:03.292: E/AndroidRuntime(606):  at app.login.DatabaseSample.onCreate(DatabaseSample.java:16)
05-10 12:42:03.292: E/AndroidRuntime(606):  at android.app.Activity.performCreate(Activity.java:4465)
05-10 12:42:03.292: E/AndroidRuntime(606):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
05-10 12:42:03.292: E/AndroidRuntime(606):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
05-10 12:42:03.292: E/AndroidRuntime(606):  ... 11 more
</code></pre>

<p>on the emulator it shows unfortunately loginapp has stopped</p>

<p>this is my DatabaseSample.java file</p>

<pre><code>public class DatabaseSample extends Activity implements OnClickListener {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        View button1Click = findViewById(R.id.Button01add);
        button1Click.setOnClickListener(this);
        View button2Click = findViewById(R.id.Button01home);
        button2Click.setOnClickListener(this);        

    }

    @Override
    public void onClick(View v) {
        // TODO Auto-generated method stub
        switch(v.getId()){

        case R.id.Button01add:
            Intent i = new Intent(this, SaveData.class);  
            startActivity(i);
            break;
        case R.id.Button01home:
            Intent i1 = new Intent(this, CheckData.class);  
            startActivity(i1);
            break;

        }
    }
}
</code></pre>
