Android :: Set Focus On Running Activity

Mar 24, 2010

I have an Activity that keeps running after the Home button is pressed (naturally) and of-course the focus is in the home screen, and when the running process ends I need to restore the focus on that activity. In more PC expression, I need to maximize the application.

Android :: Set Focus on Running Activity


Android Background Running App Focus?

Mar 15, 2012

i am using fileobserver to observe the changes in a folder.Now i want to get focus on my application UI when i create a new file inside that folder(observed). i am able to create event on creation of new file in that folder. But not able to get UI of my application in front.

View 2 Replies View Related

Android :: Activity With Two Elements - Input Focus

Oct 12, 2009

I have an android activity, with two elements:
EditText
ListView
When my activity starts, the EditText immediately has input focus (flashing cursor). I don't want any control to have input focus at startup. Stop EditText from gaining focus at Activity startup? I tried:
EditText.setSelected(false);
No luck. How can I convince the EditText to not select itself when the Activity starts?

View 5 Replies View Related

Android :: How To Find Out When Activity Starts Or Get Focus?

Mar 17, 2010

I would need to know when one activity starts or get's focus. I need this notification for any activity regardless of his type, name or whatever - not searching for one specific activity. Checked the ActivityMonitor and the Intent and I haven't found a generic intent for this purpose. Or I hadn't understood well the descriptions from the Intent ACTION_xxxxx.

View 7 Replies View Related

Android :: Moving Focus To Top Of Activity - Scrolling

Aug 26, 2009

I have an activity that begins with almost a page of text, then has a few form controls. When the activity launches, the first form control takes focus and the screen scrolls down to make it fully visible. When this happens, the text at the top is off the top edge of the screen. When the screen comes into view, I want the text at the top to be visible. So, onCreate, I tried sending a message to the Activity's overridden handler to do the following:

ScrollView main = (ScrollView) findViewById(R.id.main);
main.pageScroll(ScrollView.FOCUS_UP);
This did nothing. I then tried:
main.scrollTo(0,0); This also did nothing.
I then tried sending the message from onResume instead of onCreate. This also did nothing. How to force the scrollview to actually scroll?

View 3 Replies View Related

Android :: How To Tell Inbox Activity Focus His Rows?

Nov 3, 2009

I know the title it doesn't explain my problem exactily. It's better explain it with an example. I want put up-down arrows over inbox activity. I can select each row in the inbox message list pressing up or down arrow. I'd tried it showing two activities at time starting a new thread, but I can't get it. However, if I could put my arrows another problem appears: how can I tell inbox activity focus his rows? Then, I thought maybe I resolve my problem installing NDK, but I have a lot of problems installing it. Finally, you could think, another solution could be manage myself inbox message list; but this is not an scalable solution for me.

View 4 Replies View Related

Android :: Set Focus On TextView When Activity Starts?

Aug 16, 2010

There are an EditText and a TextView in my Activity. I want to set focus on the TextView when the Activity starts. I used the following code:

TextView myTextView = (TextView) findViewById(R.id.my_text_vew);
myTextView.setFocusable(true);
myTextView.setOnClickListener(this);
myTextView.requestFocus();

But the code doesn't work. The EditText always receives focus when the activity starts.

View 1 Replies View Related

Android : Remove Focus From Current Activity

May 26, 2010

How would i remove the focus from an activity which has just being installed/started,

so the user's focus will remine on the previous one?
(while the new activity remine in the stack and will work in the background)

the prob is that when i start this new background activity, until i wont press back or home, the ui is stuck. and i would like to fix that some how?

View 1 Replies View Related

Android :: Stop Timer When Activity Loses Focus

Nov 10, 2010

I have a Timer which executes a TimerTask every 30 seconds. I only want the timer to launch a new TimerTask if the Activity is displayed i.e. if the user receives a phone call or launches a new activity the Timer will stop. I then need the Timer to restart when the Activity is re-launched and comes into focus.

Now this should be easy, I override the "onWindowFocusChanged(boolean hasFocus)" method and either start or stop the timer depending on the value of has Focus. The way I start the timer is to create a new Timer object and TimerTask each time and the way I stop the Timer is to call the cancel() method on the Timer object and set timer to null.

My problem is this doesn't always work, if I launch the activity which has the Timer and switch orientations quickly (to start/stop the Activity) I find the Timer is not always canceled and I end up with multiple Timers launching TimerTasks at an ever increasing rate.

View 2 Replies View Related

Android :: Detect When Another Activity Is Launched Or Loses Focus

Dec 3, 2009

Like the title says, I need to detect when my app loses focus because another app is launched (Phone call comes in, or user hits Home etc.).
Overriding Activity.OnStop does not work because that is called even when switching activities within my app.

View 3 Replies View Related

Android :: Googlemaps View Activity Regain Focus

Nov 24, 2010

I have a problem with my app, it haves a lot of activitys, two of them haves googlemap views. My A activity haves a full mapview and my B activity haves a small map view. OK, when i am on the B activity and press back key somethimes until i return to my A activity, the map of my A activity shows with errors, with a black zone in the down part of the window. THis only happens when i press back from the B activity. Code...

View 1 Replies View Related

Android :: Specify Which Item Gets Default Focus On Activity Startup?

Apr 11, 2009

How can you specify which item gets the default focus on Activity startup? Using requestFocus programmatically does not work. On setContextView the first focusable item listed in the XML is given the default focus. When using RelativeLayout, the first item listed is not always the desired item or necessarily on top.

View 3 Replies View Related

Android : How To Ensure View Isn't In Focus When Activity Starts?

Oct 2, 2009

I open an Activity which has a number of elements... some TextViews, some Buttons, and an EditText. For some reason, when the activity starts, the EditText is focused by default, which causes the keypad to appear hiding the screen. I only want this EditText to be in focus if the user clicks into it. How can I ensure that this View isn't in focus when the activity starts? I've tried calling requestFocus() on one of the buttons, but it hasn't changed anything. Ideally, I don't want anything in focus at all.

View 7 Replies View Related

Android :: How To Give Focus To A Background Activity Belonging To A Different Task

Aug 4, 2010

Say that the user has started my App and then switched off to use the Browser (so we have 2 sets of Tasks running). After a while, something happens to my app that requires the user's attention, so it posts a notification to notify the user. Is there a way to bring my App's task (and the Activity on top of the stack) out from the background when user clicks on my notification?

View 2 Replies View Related

Android :: Start Activity When Main Activity Is Running In Background

Jan 10, 2010

I created an application which enables the user to set whether he wants to receive notification while the application runs in background mode. If the notifications are enabled an activity should be started (the dialog should appear on the screen).

I tried to enabled it the following way:

CODE:...........

This is the method from main activity. When onPause() is executed isRunningInBackground is set true.
When I tried to debug it when the main application was running in the background the line

startActivity(intent) had no effect (the activity didn't appear).

Does anyone know how to midify the logic in order to start an activity from the main activity when the main activity is running in the background (after onPause() is called)?

View 1 Replies View Related

Android :: How To Check If Activity Is Current Activity Running In Screen

Jul 16, 2010

I used Toast to make notification, but it seems it will appear even its activity is not in the current screen and some other activity has been started.I want to check this situation, when the activity is not the current one, I'd not send the Toast notification. But how to do ?

View 1 Replies View Related

Motorola Droid X :: Auto Focus - Click To Focus

Aug 29, 2010

I loved the camera on the Eris and the Incredible, not only did they have a whole lot more of a crisp high-res detail, the auto-focus absolutely rocked. With my droid x, I can be getting a little artsy and focus on an object with the crosshair but it'll take me 20 tries to get it to lock on, its insane, I know I'm not getting too close to my subject because it will definitely eventually focus on that object if I try over and over and over again. It's not just close ups that I find myself and my buddy with this issue either. macro shooting mode does not help. My buddie's droid X has the same exact behaviors. Eris and incredible just LOCKED ON first try with even very low contrast / detail subjects, on top of that, have a ton better camera GUI when it comes to "click to focus". I know this thing ain't no SLR but, blows me away of how terrible the camera performance is vs. the HTC android based devices. Ihink motorola will fix this? I know this thing ain't no SLR but it just blows me away how the HTC android devices camera performance (except for video) blows the Droid X away.

View 9 Replies View Related

Android :: How To Check Activity Is Running Or Not?

Jul 15, 2010

I want to show a progress dialog on the screen if the activity is showing. But when the activity window is not showing, it will not do anything. Please suggest, how do i check whether my activity is showing or not?

View 2 Replies View Related

Android :: Keep Activity Running While In Sleep Mode

Jan 20, 2010

I have a app that needs to run a command even if the phone goes to sleep. I have it running as a service but it runs randomly when. Is there a way to have the service run even when the phone is sleeping.

View 3 Replies View Related

Android :: Running Activity From Local Service

Sep 13, 2010

I'm trying to create a program with a service that runs every 10 seconds, puts the camera preview, taking a picture and then leaving the user to continue his work (closing down). Currently I have two problems:

1. After I'm taking the picture, the preview still there. There's no function like close() to return to the previous activity. How can I return to the previous activity?

2. I'm trying to run the above described activity from the run() function (from the timer class that execute the run() function every 10 seconds). When I do that, a runtime exception is raised. But when I start the above described activity from a button clicked (not from the timer) it works fine.

View 4 Replies View Related

Android :: Know Whether Activity / Service Running Or Stopped?

Apr 13, 2010

When I do various operations on bluetooth application ... scanning, renaming and discoverable after some time non of these works... if I try to change name, it is not reflecting. is it problem with Activity/service? How to check whether these are still running? How to debug such cases?

View 2 Replies View Related

Android :: Send Intent Only When Activity Is On Top Running

Apr 20, 2009

I have an activity that uses a service. While the service is running (it sends some stuff in background) I display a progress bar and disable the send button.

Now I created an Intent to update the interface after the send service has finished. How can I do this only if the activity is still on top? I tried to figure out this in the service with:

CODE:..................

View 4 Replies View Related

Android :: Running Activity From Remote Service

Apr 29, 2010

Iam trying to run an activity from diffrent package from my remote service:

This is how i implement the service.java

CODE:....

Ive also added a line in the manifest of the service:


The service works fine, but i cant run the activity -> PushActivity which is in diffrent package of diffrent application, this is the error:

Activity not found Exception: No Activity found to handle Intent {act=com.pushservice.PushServiceActivity flq=0x10

View 2 Replies View Related

Android :: Start Activity From Service - Running In Background

Nov 13, 2009

I want to develop a application that continuously running in background as service. And after that if i press any numeric key, it should start an application.

I have developed a service which is running continuously. Is it possible in Android?

View 2 Replies View Related

Android :: Show Dialog When Activity Running And Game Over?

Nov 1, 2009

I want to show a dialog to ask player "play again ?" when the game is over.I find the code can only add in a activity for dialog is a part of activity,But I should show the dialog when the game is over,in other words ,I should know the time game is over.how can I do this?

View 2 Replies View Related

Android :: Way To Find Out Current Running Activity From A Service?

Aug 4, 2009

I have been looking for this for a while but I can't find any way of doing it. A contrived example would be a service that simply displays the name of the current running activity as an Ongoing Notification. For instance, when the user is reading a particular email, the name of the activity (hopefully the email title!) would appear in the notifications window and when the user switches to read a text message, the notification would change to show the name of the new activity. Is there a way to do this in Android?

View 2 Replies View Related

Android :: Notify Running Activity From Broadcast Receiver?

Jun 26, 2010

I have an activity, it needs to response to a broadcast event.Since an activity can not be a broadcast receiver at the same time,I made a broadcast receiver.My question is: how can I notify the activity from the broadcast receiver?I believe this is a common situation, so is there a design pattern for this?

View 1 Replies View Related

Android :: How To Find Service Running When Activity Resumes?

Dec 9, 2009

I've created my first service, and it's all gone fine, except when the main activity is stopped. What I want is for a user action (button press etc) to start the service, which it does. Then I want the user, some time later, to press another button to stop the service. Which it does. But if the main activity loses focus (i.e. I go to the home screen) when I return to the activity it has no knowledge of the service anymore - even though the service is still running. When the activity resumes, how do I find out a) if the service is running, and if so b) re-bind to it, so that I can then stop it and collect the data I'm after.

View 20 Replies View Related

Android :: Pass Intent Via StartActivity() To A Running Activity

Aug 10, 2010

MyService and MyClient are both running, although MyClient is currently in the background. If MyService sends an Intent to MyClient via:

CODE:..............

How do I get this Intent in MyClient? Running this code triggers onResume() in MyClient, but because it's already running, calling getIntent() returns the Intent that initially created MyClient, which is always android.intent.action.MAIN

View 2 Replies View Related

Android :: Determine What's Active Package Or Activity Running?

Aug 16, 2009

I want my background service to determine the active package or activity running.Is this possible?

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved