How to get current focus view object in Service?

by mos.chris1...@gmail.com » Tue, 23 Nov 2010 14:49:52 GMT


Sponsored Links
 Dear All,
I want to get the current focus view in my Service to check the view
is a EditText and append some texts in it (for all EditTexts, not only
in my application).

I found some methods to do this, like Activity.getCurrentFocus() and
Windows.getCurrentFocus().
But these methods are used in a Activity.

How can I use these methods in a Service? Or is there another way to
do?

Thanks!

-- 



How to get current focus view object in Service?

by Mos » Tue, 23 Nov 2010 14:51:35 GMT


 Dear All,
I want to get the current focus view in my Service.
And to check if the view is a EditText and append some texts in it
(for all EditTexts, not only in my application).

I found some methods to do this, like Activity.getCurrentFocus() and
Windows.getCurrentFocus().
But these methods are used in a Activity.

If I want to use these, I have to get the current focus activity.
I tried to use WindowManager to get current task.
It only got the current Activity's class name in this way. not
Activity Object.
                List<RunningAppProcessInfo> rList =
activityManager.getRunningAppProcesses();
                RunningTaskInfo rt = rtList.get(0);
                rt.topActivity.getClassName(); // the class name of the current
Activity

How can I use these methods to get the current focus View in a
Service? Or is there another way to
do?

Thanks!

-- 


Sponsored Links


Re: How to get current focus view object in Service?

by TreKing » Wed, 24 Nov 2010 03:46:14 GMT


 On Thu, Nov 18, 2010 at 4:11 AM, mos.chris1...@gmail.com <




Have an activity that binds to your service, tells it when the edit text is
in view and gets a message back from the service.



To listen in on and change text on any other applications' edit texts? Uh
.... no.

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

-- 



Other Threads

1. NFC send Url p2p

Hi I would like to know how I can send a url for a nexus S nfc to
another, How can I parse the url from the mobile that receives it.
 Thank you very much

-- 

2. ISO 15693 UID inversed

I'm not entirely sure whether this is an Android issue, but the byte
array Tag.getId() returns on an ISO 15693 tag seems to return the
actual UID bytes in inversed order. Any ideas on this?

Johannes

-- 

3. Android init.rc

4. Landscape mode, in either direction

5. Asynchronous Bluetooth Apis

6. How to optimize HTTPClient.execute(....) call?

7. Display scrollbars in an adapterview