On Mon, Jul 19, 2010 at 4:47 AM, A N K ! T <[email protected]>wrote:

> while am trying to fetch current focus object i.e View ,,,,by usinggetcurrent 
> focus method ...but view object not getting any value it is
> showing null value
>

Step 1: Read the documentation:
Activity.getCurrentFocus<http://developer.android.com/reference/android/app/Activity.html#getCurrentFocus()>

"Calls 
getCurrentFocus()<http://developer.android.com/reference/android/view/Window.html#getCurrentFocus()>
on
the Window of this Activity to return the currently focused view."

OK, so let's look at
Window.getCurrentFocus<http://developer.android.com/reference/android/view/Window.html#getCurrentFocus()>
:

"Return the view in this Window that currently has focus, or null if there
are none."

Oh, so if there is no focus, you get null. Since you are getting null, you
have no focused view. Problem solved.

please let me know what shu i do now


Check for null.

Time taken posting on the group: about a day and a half.
Time taken reading the documentation: about a minute and a half.

-------------------------------------------------------------------------------------------------
TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
transit tracking app for Android-powered devices

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to