EditView: Done button not working after text entered

by MH » Thu, 06 Aug 2009 08:16:09 GMT


Sponsored Links
 Hi Folks,

I have a EditView that takes input from user - but once I enter text
using the soft keypad, the "Done" button doesn't seem to be working. I
want it to take me back to my view and exit from the keypad entry
since I'm done entering the text.
Here is how my layout is defined - what am I missing?
Thanks in advance!
-MH

<AbsoluteLayout
android:id="@+id/widget1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android=" http://schemas.android.com/apk/res/android" ;
android:background="@android:color/black">

    <EditText android:id="@+id/search_str"
        android:maxLines="1"
        android:ems="25"
        android:scrollHorizontally="true"
        android:layout_width="440px"
        android:layout_height="70px"
        android:layout_x="20px"
        android:layout_y="100px"
        android:maxEms="25"/>

    <Button android:id="@+id/button_search"
        android:text="@string/button_search_str"
        android:layout_width="100px"
        android:layout_height="50px"
        android:layout_x="80px"
        android:layout_y="200px"/>

    <Button android:id="@+id/button_search_cancel"
        android:text="@string/button_search_cancel_str"
        android:layout_height="50px"
        android:layout_width="100px"
        android:layout_y="200px"
        android:layout_x="280px"/>

    <TextView android:id="@+id/search_window_prompt"
        android:layout_height="wrap_content"
        android:layout_width="wrap_content"
        android:text="@string/search_window_prompt_str"
        android:layout_y="50px"
        android:editable="false"
        android:layout_x="180px"/>

</AbsoluteLayout>


--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Flipping views (or: the magic behind onInterceptTouchEvent)

Hi!

I want to create a new widget for Android developers which allows to
use the same functionality as seen on the home screen (flipping
between different screens), the calendar (flipping between days) or
TweetDeck (flipping through Twitter columns). The source for the
launcher is there, so I thought this might not take so long:
http://android.git.kernel.org/?p=platform/packages/apps/Launcher.git;a=blob;f=src/com/android/launcher/Workspace.java;h=2e04311f530003dbd76695f46876a785164acb99;hb=HEAD#l572

It seems that the two methods onInterceptTouchEvent() and
onTouchEvent() do all the things that are needed for getting the
events, so I copied them to a new class and removed functionality that
is for the Workspace only. You can see my work-in-progress here:
http://pastebin.com/8p8GCEZK

My problem now is: onInterceptTouchEvent() is always only called once
with the MotionEvent.ACTION_DOWN action so I never get into the
ACTION_MOVE case - where the actual fling would be initiated. I played
around with the return values of onInterceptTouchEvent() (true means
to steal events from children) and the return values of onTouchEvent()
(true means to consume the event), but I didn't get any further.

Is there some kind of magic behind onInterceptTouchEvent() or
onTouchEvent() which I didn't notice? Is my problem even solveable? I
hope so... :-)


Thanks in advance & merry christmas
Marc

PS: I also asked this question on StackOverflow, but didn't get any
answers yet:
http://stackoverflow.com/questions/4455891/android-use-realviewswitcher-to-switch-between-views-like-the-home-screen-does

-- 

2. Dynamically reading drawable file names

Is there any way for an Android app to read the file names of all the
files stored under drawable (or for that matter any other directory)?

I'd like to have it so I can plop in a new file and have the app read
the name for me for use in a dynamically sized list of radio buttons
(one button per file) that lists the name of the file by the radio
button.

I've done something like this with contacts, but I am not sure how you
read the file names from something like the drawable directory!

Thanks.

Darrin

-- 

3. TweetDeck android app like column view

4. Alert Dialog

5. need the script for back button emulation

6. Issue with startActivity

7. Fun - Android Market failure on update