绛斿: hiding a forcib ly opened soft keyboard...

by sdphil » Thu, 12 Nov 2009 11:29:53 GMT


Sponsored Links
 I'm basically doing what you show here.

What I mean by "forced" soft keyboard is when you hold down the menu
key.

It doesn't make it go away.  I tried using
view.getApplicationWindowToken vs. view.getWindowToken

and it did not make any difference.  so something else must be going
on...





> > >



绛斿: hiding a forcib ly opened soft keyboard...

by Dianne Hackborn » Thu, 12 Nov 2009 12:07:41 GMT


 h sorry 0 is correct here.  Are you sure the window you are passing in
actually currently has input focus? Fwiw, the framework code that
hides/shows the IME from long pressing on menu does basically the same thing
-- shows with the force flag, hides with 0 flags.

2009/11/11 sdphil <phil.pellouch...@gmail.com>

> > > >


Sponsored Links


绛斿: hiding a forcib ly opened soft keyboard...

by sdphil » Thu, 12 Nov 2009 14:36:44 GMT


 'm not sure about the view, but i'm sure the top most window is there
-- and i thought that's what --

getApplicationWindowToken --
Retrieve a unique token identifying the top-level "real" window of the
window that this view is attached to.

was supposed to take care.

Can I do a view.requestFocus() before calling this to ensure it has
focus?

On Nov 11, 8:06 pm, Dianne Hackborn <hack...@android.com> wrote:
> > > > >



Other Threads

1. Query the List of Favorite Contacts

Hi,

I'm trying to query the list of favorite contacts. I use the line
below:

Cursor cur = this.getContentResolver().query(People.CONTENT_URI, null,
People.STARRED + "=?", new String[] { "1" }, null);

However, this doesn't work because NULL data is returned, even though
my list of favorite contacts is not empty.

Is there a way to query the list of favorite contacts?

Thanks in advance,

Ali

-- 

2. crash in ListView.layoutChildren on display of onscreen keyboard

I also am getting a crash occasionally with this stack trace:

02-14 10:08:56.618: ERROR/AndroidRuntime(326):     at
android.widget.AbsListView.obtainView(AbsListView.java:1266)
02-14 10:08:56.618: ERROR/AndroidRuntime(326):     at
android.widget.ListView.makeAndAddView(ListView.java:1668)
02-14 10:08:56.618: ERROR/AndroidRuntime(326):     at
android.widget.ListView.fillSpecific(ListView.java:1212)
02-14 10:08:56.618: ERROR/AndroidRuntime(326):     at
android.widget.ListView.layoutChildren(ListView.java:1499)
02-14 10:08:56.618: ERROR/AndroidRuntime(326):     at
android.widget.AbsListView.onLayout(AbsListView.java:1113)
02-14 10:08:56.618: ERROR/AndroidRuntime(326):     at
android.view.View.layout(View.java:6830)
02-14 10:08:56.618: ERROR/AndroidRuntime(326):     at
android.widget.FrameLayout.onLayout(FrameLayout.java:333)
02-14 10:08:56.618: ERROR/AndroidRuntime(326):     at
android.view.View.layout(View.java:6830)
02-14 10:08:56.618: ERROR/AndroidRuntime(326):     at
android.widget.FrameLayout.onLayout(FrameLayout.java:333)
02-14 10:08:56.618: ERROR/AndroidRuntime(326):     at
android.view.View.layout(View.java:6830)
02-14 10:08:56.618: ERROR/AndroidRuntime(326):     at
android.widget.FrameLayout.onLayout(FrameLayout.java:333)
02-14 10:08:56.618: ERROR/AndroidRuntime(326):     at
android.view.View.layout(View.java:6830)
02-14 10:08:56.618: ERROR/AndroidRuntime(326):     at
android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119)
02-14 10:08:56.618: ERROR/AndroidRuntime(326):     at
android.widget.LinearLayout.layoutVertical(LinearLayout.java:998)
02-14 10:08:56.618: ERROR/AndroidRuntime(326):     at
android.widget.LinearLayout.onLayout(LinearLayout.java:918)
02-14 10:08:56.618: ERROR/AndroidRuntime(326):     at
android.view.View.layout(View.java:6830)
02-14 10:08:56.618: ERROR/AndroidRuntime(326):     at
android.widget.FrameLayout.onLayout(FrameLayout.java:333)
02-14 10:08:56.618: ERROR/AndroidRuntime(326):     at
android.view.View.layout(View.java:6830)
02-14 10:08:56.618: ERROR/AndroidRuntime(326):     at
android.widget.FrameLayout.onLayout(FrameLayout.java:333)
02-14 10:08:56.618: ERROR/AndroidRuntime(326):     at
android.view.View.layout(View.java:6830)
02-14 10:08:56.618: ERROR/AndroidRuntime(326):     at
android.widget.FrameLayout.onLayout(FrameLayout.java:333)
02-14 10:08:56.618: ERROR/AndroidRuntime(326):     at
android.view.View.layout(View.java:6830)
02-14 10:08:56.618: ERROR/AndroidRuntime(326):     at
android.view.ViewRoot.performTraversals(ViewRoot.java:996)
02-14 10:08:56.618: ERROR/AndroidRuntime(326):     at
android.view.ViewRoot.handleMessage(ViewRoot.java:1633)
02-14 10:08:56.618: ERROR/AndroidRuntime(326):     at
android.os.Handler.dispatchMessage(Handler.java:99)
02-14 10:08:56.618: ERROR/AndroidRuntime(326):     at
android.os.Looper.loop(Looper.java:123)
02-14 10:08:56.618: ERROR/AndroidRuntime(326):     at
android.app.ActivityThread.main(ActivityThread.java:4363)
02-14 10:08:56.618: ERROR/AndroidRuntime(326):     at
java.lang.reflect.Method.invokeNative(Native Method)
02-14 10:08:56.618: ERROR/AndroidRuntime(326):     at
java.lang.reflect.Method.invoke(Method.java:521)
02-14 10:08:56.618: ERROR/AndroidRuntime(326):     at
com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:860)
02-14 10:08:56.618: ERROR/AndroidRuntime(326):     at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
02-14 10:08:56.618: ERROR/AndroidRuntime(326):     at
dalvik.system.NativeStart.main(Native Method)

I am doing a pretty plain jane Cursor load of the List without any
threading:

protected void onCreate(Bundle savedState)
   {
           super.onCreate(savedState);

           ContentResolver cr = getContentResolver();

           String[] projection = new String[] { TrackHeader._ID,
TrackHeader.DESCRIPTION, TrackHeader.CREATION_TIME,
                                                                                
        TrackHeader.CATEGORY, TrackHeader.DURATION,
TrackHeader.DISTANCE,
                                                                                
        TrackHeader.POSTED };

           Cursor c = cr.query(TrackHeader.CONTENT_URI, projection, null,
null, null);
           startManagingCursor(c);

           TrackHeaderDataAdapter adapter = new TrackHeaderDataAdapter(this,
R.layout.track_list_item, mCursor, projection, null);
           setListAdapter(adapter);

Any ideas?

Tim





-- 

3. Broadcast Receiver without Activity.

4. Text To Speech Android 1.6 with minsdk 3

5. Smaller tabs, such as the Facebook official app

6. New sales have come to a halt Developer console stopped updating?

7. CyanogenMod 5.0 for Nexus One (STABLE) is out