Android :: Behavior Of Activity For Cases
Mar 18, 2010
1. I want to know the behavior of activity for the cases where onStop and on Destroy were not called like low memory situations.
2. I was registered my handler in on Create() and unregistering in on Destroy, what is the behavior if other thread sends messages to the registrants after the activity was killed by android without calling on Destroy. I know that those handler were not removed by GC as they are still referring by the thread.
3. Also suggest me to handle the above situations.
View 3 Replies
Apr 23, 2010
I have the following activity structure in my application A simple "splash screen" activity is started when the application is fired up (let's call it "Splash"). This activity starts the main activity when the user presses a button (I will call it "Main"). Main can in turn start two activities from the menu. The first activity presents a simple form (let's call this one "Form"), the second is a MapActivity that presents a map (it is called "Map").
Main, Form, and Map are declared exactly the same in the manifest:
<activity android:name="fully qualified activity class"
android:screenOrientation="landscape"
android:configChanges="keyboard|keyboardHidden|orientation"
> <intent-filter>
<action android:name="android.intent.action.DEFAULT" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter> </activity> When Main is active and I start Form and press "back", Main comes up again. Pressing "back" again brings up "Splash". Nothing strange here.Now comes the strange part: when I am in Main, start Map, and press "back", Main comes up as expected. But pressing "back" again just restarts Main. A second press on "back" is needed to bring me back to Splash!So it seems that starting the Map activity somehow results in Main ending up on the activity stack twice while starting the Form activity does not! Both Form and Map are started like this: start Activity(new Intent(this, MyActivity.class)); I don not catch the back key in any activity.Any clues on what is going on or how to debug this?
View 1 Replies
View Related
Oct 24, 2009
I have a package with two activities
1. A main activity 2. A search activity
The search activity is invoked by a search suggestion provider in two possible ways
1. By clicking directly on a suggestion invoking the search activity through a VIEW action 2. By clicking on the explicit search icon invoking the activity through SEARCH action
If it is invoked through SEARCH I stay on the search activity and show some text to the user. Now when I click the back button I go back CORRECTLY to the home page.
ODD Behaviour: However if I came to the search activity through the VIEW, I invoke a browser activity and call finish() on the search activity. Now I have the browser in my view. If I now go back I would expect to go back to teh device home page. But from now where the "main activity" is showing up.
I see in the logcat a message from ActivityManager indicating
moveTaskToBack: 8
I have tried various flags to invoke the browser activity the tried flags include new task previous is top and I have also tried both a singleTop and otherwise with the SearchActivity as well. Same end result.
View 2 Replies
View Related
Jul 13, 2010
Does anyone know how to set the notifications behavior on the EVO? Specifically with Google Talk? I would like the phone to beep at me only once when someone sends a google talk message, and then not ever again for the following messages until I unlock the phone's screen and reactivate the google talk app. I think it already works this way for email, but not for Gtalk. Can this be done? And, I already know that if I open up the chat session, the sounds shut off on successive messages. However I would like it to stop the beeping without opening the chat window.
View 1 Replies
View Related
Apr 21, 2010
I want to customize the spinner behavior a little bit. I want to add a couple of buttons at the end of the drop down menu that is displayed when the user selects the control. Any idea how this could be done?
View 4 Replies
View Related
Sep 20, 2010
I have a ListView set up in single-choice mode like this:
<ListView android:id="@id/android:list"android:layout_width="fill_parent"
android:layout_height="fill_parent" android:background="#ff444444" android:layout_weight="1"
android:drawSelectorOnTop="false" android:choiceMode="singleChoice" android:scrollbars="vertical"
android:headerDividersEnabled="true"/>
When I press my finger on a choice, the selection changes from white text on light gray to black text on orange. But as soon as I lift my finger, the selection reverts to the original state. I'd like that chosen row to remain in the black-text-on-orange mode when I lift my finger so that the user knows what was selected in the list (my onClickListener has captured the selected row, of course). Is there a way I can tell the ListView that I want this behavior or something similar so the user knows what item has been selected?
View 6 Replies
View Related
Oct 18, 2010
I have a TextView which is inside a LinearLayout which is in the child position of an ExpandableListView. Without assigning a color state selector to the text view, the following behavior is observed:Text unselected - text paints as white Text selected - text paints as black.If I add a color state selector with a call to text.setTextColor(R.color.textcolorstatelist) then the following behavior is observed:Text unselected - text paints as black Text selected - text paints as black.I tried two versions of textcolorstatelist.xml and both produced the results above.
View 9 Replies
View Related
Sep 30, 2010
I am using a handler inside my service to display notifications at a certain time using the Handler.postDelayed method. My application runs fine on the emulator just as expected satisfying all cases. But when I installed the same on my HTC Wildfire, it simply doesn't happen as anticipated. Notifications are displayed at a random manner after the scheduled time and some notifications even fail. I'm monitoring my service from the Applications > Running Services and still my service is active.
View 1 Replies
View Related
Mar 16, 2009
I am trying to add ringtones to the media/ringtones folder from my application. If the phone is connected via USB to a computer or mounted on my Mac, the ringtones do not show up in the SD Card, nor in the Ringtone settings.
But if I run the application with the USB unplugged, the ringtones appear ok. This is not a problem with Ringdroid which does the same thing.
View 2 Replies
View Related
Jul 10, 2010
I got two kind of lists on 4 different views. All lists are clickable and starts an activity to read the clicked record. One is just a listview populated from the DB and works fine. The second is also a listview populated from a DB but has a addHeaderView. This makes the list forget where it was when you return from the listview's intent. If I remove the addHeaderView(); it works fine. Why does AddHeaderView changes or even malfunctions ListView's behavior?
View 2 Replies
View Related
Jul 13, 2009
I changed my database schema on my application to include an additional column in one of the tables. I did this in the onUpgrade method in the DBHelper.
Then I tried exporting my signed application and reinstalling it using the 'adb install -r <app>.apk' command to try and 'simulate' an application upgrade, but onUpgrade never gets called.
Is there a command that I can use to try and duplicate the behavior of an application upgrade?
View 3 Replies
View Related
Oct 1, 2010
I have an audio player toolbar activity that has a corresponding layout file.
I need this player to show up at the bottom of another activity. I use a ViewStub and inflate the audio toolbar's layout file in the stub.
How do I access the buttons, etc on this inflated view and how do I set their behavior?
The docs on ViewStub did not mention anything about this (or maybe I totally overlooked something).
View 1 Replies
View Related
Jul 6, 2010
As i said we NEED otterbox cases for sprint prefable for the Htc evo 4g i hate my crappy bulky case that i bought for 40$usd at best buy. anyone know of a case with a extended batters in the case like for the iphone? or a thin case thats thick up top to protect the lens and show the htc symbol.
View 7 Replies
View Related
Oct 1, 2009
I'm looking around and trying to find out where sleep behavior is documented - and I mean in the general sense.
When the phone is left alone: * Sometimes the phone screen dims and doesn't shut off. * Sometimes the phone screen goes dark in five seconds * Sometimes the menu lock happens. * Sometimes the menu lock doesn't happen. * Sometimes the only way to darken the screen is to push the power button.
What's not clear is what triggers these different states. I'm looking for a complete list I can use in testing and application validation.
View 6 Replies
View Related
Jun 7, 2010
I wrote an app that invokes the contact manager in the following way: Intent pickcontact = new Intent(Intent.ACTION_PICK, People.CONTENT_URI); startActivityForResult(pickcontact, CONTACTPICKED); I am experiencing 2 different behavior between HTC phones and the NexusOne, all with firmware 2.1-update1. (i.e., my application is getting access to all my contact along the primary phone number of that contact list). On HTC phones however (incredible and the hero), the list of contact I get represents some sort of index as opposed to the actual contact name/phone number.
View 4 Replies
View Related
Mar 31, 2010
I have an app with two activities, one of which the launchmode is set to "singleTask". From the Android dev guide, I got the impression that my SingleTaskActivity should start a new task (or reuse an old task) and always sit at the root of the stack when launched.
However, it's inconsistent with the behavior of the app if I follow the steps below: - launch StandardActivity from home - click the "home" key - launch SingleTaskActivity from home, you will see it's in the foreground as expected - click the "Back" key, StandardActivity comes to the foreground whereas I expect to see the home screen because SingleTaskActivity is supposed to be at the ROOT of the stack. It appears SingleTaskActivity was launched into the task that StandardActivity started, rather than starting its own task.
Is my understanding about the "singleTask" launch mode correct?
=== The Android Dev guide (http://developer.android.com/guide/topics/ manifest/activity-element.html#lmode) says:
In contrast, "singleTask" and "singleInstance" activities can only begin a task. They are always at the root of the activity stack. Moreover, the device can hold only one instance of the activity at a time — only one such task.
CODE:.....................
View 5 Replies
View Related
Sep 28, 2010
I have noticed that loading an image into a GLTexture using
CODE:........
Will create a texture with premultiplied alpha. Not a problem, as long as I use glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA) to blend instead of glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) which will cause dark borders.
However, I've found that if I render text onto the Bitmap and convert to glTexture using:
CODE:........
The resultant texture is NOT premultiplied, and using glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA) will cause ugly over- saturated edges when blended into the 3D world. Blending using glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) makes it look right again.
To confirm this, I saved the bitmap into a PNG file and load it as a resource into a texture, and the resultant texture is premultiplied and renders correctly using glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA)
Is there a way to force the text rendering onto the bitmap to be pre- multiplied?
View 2 Replies
View Related
Jun 4, 2009
I noticed that the imeOptions attribute on TextViews behaves inconsistently across different devices. For instance, setting imeOptions to "normal" has the following effects:
1) On the emulator and G1s running 1.5: The OSK will have a "Done" key and clicking it will simply close the OSK with no further action taken (this is exactly what I need)
2) On my HTC Magic (G2), also running 1.5 (of course): The OSK will have an enter key (showing the enter symbol instead of "Done") and when clicking it, the OSK will close and bring up the context menu of the text view... I mean, seriously. That is the last thing any user or developer would expect it to do.
There seems to be no way to simply close the OSK after entering some text on the G2, *except* when specifying flagNoEnterAction in imeOptions, which on the G2 does what "normal" does on the G1, but on the G1, this will lead to the OSK to not respond at all to the enter key (user has to hit "back" to close the OSK).
This is a complete mess, is there any way to have the OSK behave in a sane manner without resorting to hacks (like checking for device models and setting imeOptions programmatically)? Didn't Google say they cared about backwards compatibility before releasing Cupcake? I have nothing but trouble getting my app to look and behave identical on different Android models.
View 4 Replies
View Related
Aug 12, 2009
In my app, a user picks video content with Intent i = new Intent(Intent.ACTION_GET_CONTENT); Code...
Why is the behavior for video and audio different?
View 3 Replies
View Related
Jul 2, 2010
In my Android app, I have some data that needs to be synced daily but also needs to be updated every hour when a user is inside the app. I have already implemented a service that gets called from an alarm for the daily update. I'm having a problem with developing a strategy to do the hourly sync. I could use an hourly alarm too and fire the same intent, but since your app can be killed at any time, there would be no way to cancel it (and since they use the same Intent, doing a cancel would cancel ALL alarms including my daily sync, so that's probably not good). The other option is to use a Timer that's set when inside the app, and have that fire my Intent when inside the app. I'm assuming all Timers get canceled when an app is killed right? But my app consists of several activities and I want the timer to work across all activities, how do I do that? I dont want to duplicate code - we're already using a subclass for Activity and ListActivity.
View 2 Replies
View Related
Sep 28, 2010
When I change the background color of a list item it no longer flashes green when selected. Is there a way to retain this default behavior when the background is changed?
View 2 Replies
View Related
Sep 16, 2010
I have been trying now for a few hours to reverse the scrolling of behavior of the ListView. Essentially when scrolling down with my finger I want the list to scroll up!
View 1 Replies
View Related
Feb 4, 2010
I have a listview showing contacts.
When I'm scrolling the list the scroll works pretty smooth however when/if I'm trying to continue the scroll in the middle of the last scrolling the scroll just stops and sometimes the item I clicked on is selected (I have registered an OnClickListener to the item view).
I would like to get smooth scrolling just as in the device native contact list.
My implementation builds each contact a view containing: 1. Big picture for the contact image. 2. Small picture for the type of the contact. 3. TextView with the Contact name 4. TextView with some extra text about that contact.
My current layout for every item looks like:
CODE:........................
I've tried changing the LinearLayouts to relative ones but saw no improvement in performance.
I've created my own "Selector" in code (to eliminate the time it takes to load the resource) so that odd rows will have different background color. The code looks like:
CODE:........
View 3 Replies
View Related
Oct 7, 2009
I've created a test project with three identical classes that extend BroadcastReceiver, named
TestReceiverOne TestReceiverTwo TestReceiverThree
They each have the following function as their content:
CODE:...................
I've added each BroadcastReceiver class to the manifest, have it accept the appropriate action/category, and start debugging. I've set breakpoints in the onReceive method of each test class, and in the anonymous inner BroadcastReceiver in my onCreate.
Unfortunately, I seem to be getting somewhat undefined behavior. Sometimes getResultExtras in my second onReceive will return null. Sometimes getResultCode in the second onReceive returns 0. Sometimes I'm 1 off in my third onReceive. Sometimes I get the wrong numResults in onReceive in my activity.
Is there some other behavior I have to specify when using setResult and getResult in an ordered broadcast?
View 2 Replies
View Related
Jan 12, 2010
What's the app that changes the default end call behavior? I believe it gave multiple options beyond defaulting to the call log, as I frequently misdial after ending a call.
View 1 Replies
View Related
Mar 2, 2010
I'd like to disable the feature of virtual keyboard of 2 spaces gives a period.
I noticed that configurations for the hardware keyboard have this option.
I'm using Android 2.0 on Motorola Milestone
View 2 Replies
View Related
Oct 15, 2010
I have a LinearLayout with two views in it, an ImageView and a TextView. The ImageView resource is actually pulled from an xml selector in res/drawable so that it shows one of two drawables, call them selected.png and unselected.png. When I call LinearLayout.setSelect(false) the unselected.png drawable appears and the text is drawn in white. When I call LinearLayout.setSelect(true) the selected.png drawable appears and the text is drawn in black. How can I change this behavior of the TextView so that it always draws in white?
View 4 Replies
View Related
Oct 27, 2010
I want to change the behavior of back button,
I have 3 activity, activity1, activity2, and activity3
another activity, activity4 is a login activity
start ->activity1-----click---->Activity2-----click---->activity3
CODE:......................
Now my question is that, when i click on apps, i want to start activity4. I'm not able to do this, always start of application is opening the activity2 in this case (back button).
View 2 Replies
View Related
Feb 24, 2010
I guess ur doing it correctly.While running the test cases already provided by the PVcore,one can only see the logs and not the output on the screen or the speaker. This is what my experience says.Other people who worked on this can confirm.
View 2 Replies
View Related
Mar 3, 2010
Can we write instrumentation test cases for an android application in Groovy? If so , how ?
View 1 Replies
View Related