• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps simple search widget

v1nsai

Member
I'm flexing my java muscles for the first time in a while and trying out Android SDK. I'm trying to write a simple search widget for my home screen, but as of right now I can't even get it to display the 3 elements I have defined in a LinearLayout in any kind of window.

I've written the main.xml and strings.xml, and I'm using a basic setContentView to call it, like so
Code:
public class gSearch extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    }
}
Here's main.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="horizontal"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
    <ImageView
        android:id="@+id/gicon"
        android:src="@drawable/gicon"
        android:adjustViewBounds="true"
        android:layout_height="fill_parent"
    />    
    <EditText
        android:id="@+id/searchstring"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="@string/hello"
    />
    <Button
        android:id="@+id/search"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:text="Go!"
    />
</LinearLayout>
and strings.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="hello">Enter search here</string>
    <string name="app_name">gSearch</string>
</resources>
I think thats all the relevant info, this should be the easy part but its had me stuck in a rut for a while now, could someone give me a push? :-D

EDIT:
I found some more errors in the debugger, the boostrapper isn't finding /sys/class/switch/test or test2 and its causing more errors. Now trying to figure out what that means -_-
 
Back
Top Bottom