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. Have you used PhoneGap?

Was wondering if anybody here has used PhoneGap (http://
www.phonegap.com) before to build their Android app? Would love to
hear your thoughts on the product. I'm interviewing Andre Charland(CEO
and Co-Founder) and Joe Bowser (Android developer) of Nitobi (maker of
PhoneGap) tomorrow (April 29) at 9am pacific on the weekly MOTODEV
Android podcast at http://blogtalkradio.com/motodev  Let me know when
you can. Thanks.

Randy Ksar
randy.k...@gmail.com
http://twitter.com/djksar
--~--~---------~--~----~------------~-------~--~----~

2. I am unable to use the 1.5 sdk

Hi friends,

Currently, I am using the 1.0 android sdk (android-sdk-
windows-1.0_r2).

Now I want to move to new sdk 1.5.

I have done the following steps to install the new sdk.

1. downloaded the android-sdk-windows-1.5_pre.zip

2. unzip and ran the following command: emulator -wipe-data

3. Updated PATH variable.

4. Since I am currently using 1.0 sdk, I just tried to change the
Update Eclipse SDK Preferences
when I tried to update the Eclipse preferences, I got the error:

               "Could not find E:\android-sdk-windows-1.5_pre
\android.jar!"

5. what should I do now? what wrong I am doing.

Can any one please suggest me to solve this issue.

Thanks,
Manoj.


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

3. Widget Performance Question

4. How to start an Intent from preference page AND GET RESULTS?

5. How to detect whether the virtual keyboard is visible or not? SDK 1.5

6. how to connect adb to a target that uses DHCP to get IP addr

7. Installing Image on ADP