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.

Android : How to ensure View isn't in focus when activity starts?


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 :: 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 :: 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 :: Ensure Only One View.Re­nderer?instance Of GLSurfaceView / GLSurface

Aug 22, 2009

i am using android.opengl.GLSurfaceView in my game, which is working well expect under one condition: Starting the game a second time after leaving it by pushing the home button, causes the game to flicker, because the rendering thread from the previous instance is still running and firing OpenGL commands. Now the question is, how can i ensure that only one instance of GLSurfaceView/GLSurfaceView.Renderer gets created?

To solve/workaround the problem i've tried to set the following properties in the manifest file to to ensure the activity gets shut down if it gets inactive.

android:configChanges="keyboardHidden|orientation"
android:launchMode="singleTask"
android:multiprocess="false"
android:noHistory="true">

But without success, the activity/rendering thread still keeps running. Do you know of any certain way to exit the rendering thread/free GLSurfaceView?

View 3 Replies View Related

Android :: How To Ensure None Of Views Focused When Activity Opens?

Oct 5, 2010

My application opens in Activity A1. None of the views in A1 are focused at startup, until I use the arrow keys to navigate through the views. A button press in A1 launches activity A2. When A2 opens, the first Button in A2 is focused by default. I do not want this happen. What I want is when A2 opens, none of the buttons are focused until arrow keys are used to naviagte through them(just like it is in A1).

View 1 Replies View Related

Android :: Ensure That IME Show / Hide Results In Call To View.onSizeChanged()?

Mar 2, 2010

How do I ensure that I get the 'resize' behavior when the IME is shown/hidden?

I've included the following in my manifest:

android:windowSoftInputMode="adjustResize"

What else am I supposed to add? I've read that the container that the View is placed in should 'support resize' but what layouts support this?

View 3 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 :: List View Focus - Child View As Background

Jun 25, 2010

In my app i'm setting background to each child views in listview. So that listview default focus ( orange color ) is not focusing. Is there any way to set both ( listview focus & child view background)?

View 1 Replies View Related

Android :: Does Android Ensure That An Activity Is A Singleton?

Aug 3, 2010

If an Activity is a singleton in practice, I think I can gain some efficiency by declaring appropriate members "static", with zero risk. Yes?

View 4 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 :: Want To Set Focus To Xyz View Object Pro Grammatically

May 7, 2009

We see API for saying which is the next focusable view.. however during the event handling we want to set the focus to xyz view object pro grammatically . Is that possible.

View 3 Replies View Related

Android :: How To Run The Focus Item On The View Without Using Onclick

Jul 20, 2009

If I want to execute the focused item on the view, I need to select focused item and press enter. Now I want to find another way to execute it without using click action. Does everyone know the other way? Thank you very much.

View 2 Replies View Related

Android :: Not Getting Focus On Custom View For Autocompletetextview

Aug 27, 2009

I have made custom view for autocompletetextview, but when I am trying to select any entry from that dropdown using touch or dpad, it is not showing any focus on it, so what can be problem in that?

My code is as under.

Custom view adapter code regarding to UI:

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

View 2 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 :: Place Focus In Child View Of List Row?

Mar 12, 2009

I have ListView, where each row contains two edittext boxes. I'd like on list item selected(using Dpad) place focus on first edittext box. I tried the following code, but it does not work: ListView list = (ListView) findViewById(R.id.list); OnItemClickListener click_listener = new OnItemClickListener() {public void onItemClick(AdapterView<?> parent, View view, int position, long id){EditText box1= (EditText ) view.findViewById(R.id.box1); box1.requestFocus(); return ;} list.setOnItemClickListener(click_listener);}

View 2 Replies View Related

Android :: Give Text View Focus / Want Briefly With Example?

Aug 27, 2009

How can we give text view focus?

Tell briefly with example.

View 3 Replies View Related

Android :: Set Focus On A View When A Layout Is Created And Displayed?

Jan 27, 2010

Currently, I have a layout which contains a Button, a TextView and an EditText. When the layout is displayed, the focus will be automatically put on the EditText, which will trigger the keyboard to show up on Android phone. It is not what I want. Is there any way that I can set the focus on TextView or on nothing when a layout is displayed?

View 6 Replies View Related

Android :: Want To Get Current Focus View Object In Service?

Nov 18, 2010

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?

View 2 Replies View Related







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