Hey guys I have this odd problem and i cant pinpoint the problem. I
get a null pointer exception when i try to run the program, and i dont
even know how to search for this problem.
here is my program i am running:

package com.googlecode.shmolderinseeqpod.android;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class shmolderinseeqpodandroid extends Activity {
    /** Called when the activity is first created. */
    @Override
    protected void onCreate(Bundle savedValues){

        super.onCreate(savedValues);
        setContentView(R.layout.main);
        final EditText searchquery = (EditText) findViewById(R.id.entry);

        final Button clearbutton = (Button) findViewById(R.id.ok);



        clearbutton.setOnClickListener(new Button.OnClickListener(){
                public void onClick(View v){
                        searchquery.setText("");
                }
        });


    }
}






here is my main.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/
android"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical"
                android:padding="10dip">

                <ImageView id="@+id/image"
                        android:layout_width="fill_parent"
                        android:layout_height="wrap_content"
                        android:src="@drawable/seeqpod"
                         />

                <TextView id="@+id/label"
                        android:layout_width="fill_parent"
                        android:layout_height="wrap_content"
                        android:text="Type your search query here:" />

                <EditText id="@+id/entry"
                        android:layout_width="fill_parent"
                        android:layout_height="wrap_content"
                        
android:background="@android:drawable/editbox_background"
                        android:layout_below="@id/label"/>

                <LinearLayout xmlns:android="http://schemas.android.com/apk/res/
android"
                        android:layout_width="fill_parent"
                        android:layout_height="wrap_content"
                        android:orientation="horizontal"
                        android:padding="10dip">
                                <Button id="@+id/clear"
                                        android:layout_width="wrap_content"
                                        android:layout_height="wrap_content"
                                        
android:layout_gravity="center_horizontal"
                                        android:clickable="true"
                                        android:padding="10dip"
                                        android:text="Clear" />

                                <Button id="@+id/ok"
                                        android:layout_width="wrap_content"
                                        android:layout_height="wrap_content"
                                        
android:layout_gravity="center_horizontal"
                                        android:padding="10dip"
                                        android:text="Search" />
                </LinearLayout>

</LinearLayout>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to