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.

Android :: How to find out when Activity Starts or Get Focus?


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 : 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 :: Data Of Previous Activity Gone When New Activity Starts

Dec 30, 2009

I am developing an application in which the user require to register first and than got the user page. For that i have made layout and the layout consist many fields, so, i have made part of layout and also made the separate activity for the each layout. The layout like address, phone, etc... After that i have wrote the code for calling an activity and it works fine. It means when i press the "Next" button the another page will come and it will also consist some textview ,edittext and previous and next button. Actually, i want something different like -- When the user fill the first form and he will proceed to next, the content written by the user should not gone when the user press "Next" button. The content should be there which was written by user. And same way i have have 6 pages like that way to complete the registration process. So, have you any idea to solve above problem? I really need your help because right now i stuck at this point. So, please any body help me out of this problem. I would appreciate your help. I am waiting for your reply.

View 15 Replies View Related

Android :: Activity Starts Remote Service

Oct 8, 2010

My initial activity is basically a splash screen while preforming initialization and login in to network server. To save memory I want to finish() the splash activity once it starts the main menu activity. I still want the remote service to operate. Testing shows it does. But am I going to get into trouble doing this? I know I can restart the remote from the main menu activity but I am trying to save overhead by not starting it twice. The remote service is required by the splash activity.

View 1 Replies View Related

Android :: Best Way For Service That Starts Activity To Communicate With It

Feb 16, 2010

I have a service that listens to a socket. When receiving certain input it is to create an activity. When receiving other input, it is to kill this activity. I have struggled for a while to make the service communicate with the activity through AIDL (http://developer.android.com/guide/developing/tools/aidl.html), but this seems to not be effective. I think AIDL is only effective when the process that is to be talked to is a service, not when it is an activity? I would love some directions or suggestions on how to solve my problem.

View 1 Replies View Related

Android :: How To Start Animation When Activity Starts?

Aug 21, 2010

I need to start a animation automatically for a activity without any user clicking. I know when activity is not ready, animation could not start. I used a thread to start it, however it is still not working.

View 4 Replies View Related

Android :: Crash When Activity Starts Up And Screen Gets Rotated?

Jun 26, 2009

I am getting a crash intermittently when my Activity starts up either initially or when the screen gets rotated I get several log messages which I have been unable to get any insight from: timeout expired mFreezeDisplay=1 mFreezeCount=0 App freeze timeout expired Force clearing freeze then lots of: Lock_layer timed out (is the CPU pegged?) Key dispatching timed out then I get ANR annotation: keyDispatchingTimedOut the trace has alot of sending signal 3 to alot of PIDs

View 2 Replies View Related

Android :: Soft Keyboard Appears When Activity Starts

Aug 13, 2010

I have an activity which loads a TableLayout. This is made up of TextView and EditView fields. When I run my app within the emulator the layout appears correctly (WITHOUT the soft keyboard appearing). When I run the app from a device (HTC Evo) and enter the activity the soft keyboard ALWAYS appears. I tried doing an OnFocusChange() for the first field in the layout and then doing:

InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(tvIndications.getWindowToken(), 0);

It doesn't work. The soft keyboard always appears.

View 4 Replies View Related

Android :: Show Soft Keyboard When Activity Starts

Mar 17, 2010

I have 2 activities, A and B. When A starts, it checks for a condition and if true, it calls startActivityForResult() to start B. B only takes text input so it makes sense for the soft keyboard to automatically pop up when B start. When the activity starts, the EditText already has focus and it ready for input. The problem is that the keyboard never shows up, even with windowSoftInputMode="stateAlwaysVisible" set in the manifest under the <activity> tag for B. I also tried with the value set to stateVisible. Since it doesn't show up automatically, I have to tap the EditText to make it show.

View 2 Replies View Related

Android :: Soft Keyboard Does Not Show When Activity Starts

Apr 26, 2010

I have added android:windowSoftInputMode="stateAlwaysVisible" to my Activity in AndroidManifest.xml and here's my layout:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent">
<EditText android:id="@+id/EditText01" android:layout_width="wrap_content"
android:layout_height="wrap_content"></EditText>
<EditText android:id="@+id/EditText02" android:layout_width="wrap_content"
android:layout_height="wrap_content"></EditText>
<Button android:id="@+id/Button01" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:text="Send"></Button>
</LinearLayout>

When the Activity starts, the EditText is focused, but soft keyboard isn't displayed. If I click on the EditText, then I see the soft keyboard. Do I need to set aditional parameters to display soft keyboard when my Activity starts?

View 4 Replies View Related

Android : How To Prevent Multiple Clicks / Activity Starts?

Oct 1, 2010

If I have a button that starts an activity, and the activity sometimes takes a second or two to throw up its own view, how can I most simply and reliably protect against the button being clicked multiple times and kicking off multiple (identical) activities?

View 12 Replies View Related

Android :: No Permission In Manifest File For Call But Activity Starts?

Jan 30, 2009

I just created a simple application, that starts the Dial Activity and place a call. I did not provide any permission in the manifest file to start a call, but still the call activity starts. I also checked the AndroidManifest.xml file, there is no permission added, still the activity starts.

View 6 Replies View Related

Android :: Widget Starting Service Also Starts Main Activity

May 3, 2010

I have a widget that is supposed to start and stop a service (start it when it's not running, stop it when it is). This is working fine, however, each time the service is started, my app's main activity is also launched, which I don't want from the app's manifest, it works as I want it to (without launching the main-activity, just the service), but then I obviously don't have a main activity anymore.This is how I start the service (I would assume this is the normal way, and I can't see any reference to what might cause the MAIN intent to fire).

View 1 Replies View Related

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.

View 1 Replies View Related

Android :: Acitivity Managing - Always Starts New Instance Of Activity And Fetch Data From DB

Nov 17, 2010

I have been in problem of the Activity life-cycle. All though i read lots of docs on it put on getting clear picture on it. I have Activity A. In that activity I have menu options. If we click any option it opens the respective activity like if i click on 2nd button it opens Activity B Now again Activity B has same options into it. When user clicks on 1st button then i need to go back to activity A. So using this. Intent intent = new Intent().setClass(context, Articles.class); startActivity(intent); So always it starts new instance of activity and fetch data from DB. I want something like Activity A can be resumed back as it was.

View 6 Replies View Related

Android :: Pausing VideoView When Launching A New Intent / Resume It To Starts Up Activity Again?

Jul 23, 2009

I have an activity that is showing a video and when the user clicks a button, a new activity is launched. When the video activity stops, I pause the video view. When the video activity starts up again, I try to resume the video view videoView.start(), however, the video starts over from the beginning. I'm thinking that the buffer must be lost somewhere, so I now try to capture the current position via videoView.getCurrentPosition(), however, this is always returning 0.

Anybody know how to resume video playback when an activity starts up again?

View 5 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 :: 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 : 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 :: FinishFromChild And OnActivityResult Not Firing When Child Starts Activity Of Same Type As Parent

Jun 8, 2010

I have an application, which (for the sake of simplicity) has two types of activities - Overview and DetailView. The Overview activity shows a list of steps and allows the user to start a DetailView activity corresponding to the step chosen.

In the DetailView activity, the user can start another Overview, which shows different steps than the ones in the parent of the current DetailView.

In the Overview, DetailView is started by using startActivityForResult (). In the DetailView, when the user decides to start a second Overview, I call setResult () and finish () and then start the new Overview. In this scenario, onActivityResult () and finishFromChild () do not fire. Instead, they fire when the parent finishes (?).

Code from Overview:

CODE:....

Code from DetailView:

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

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 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 :: Way To Present List To User Where Each Item On List Starts An Activity When Selected

Nov 4, 2010

I am on my first Android application and I am on a timeline so details and examples will be useful since my knowledge is still minimal. I want my first screen to present the user with a list of activities to choose from. In my situation it is a recipe app where the user first chooses the type of food, such as, Beef, Chicken, or Pork. I want the application to launch an activity depending on the list item that the user clicked on. I am not sure if I should use a list view, a text view, a scroll view, a list activity, an activity group...

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 :: Can An Activity Find Out Where It Started From?

Jun 18, 2009

Is there a way to do this?

Can you access the activity stack in a way to grab what activity came before the one now in view?

I have a situation where an activity needs to know where it was started from, so it knows what data to display in that current activity.

View 7 Replies View Related







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