Android :: Removing / Destroying Objects When Screen Is Rotated
Jan 25, 2010
I am finding that performance degrades after one or more screen rotations, and I presume that this is likely to be because an App's main Activity is destroyed and recreated each time the screen is rotated and that my app must be leaking memory when that happens.I have read that, contrary to what one might expect, not all the objects created by an app's main Activity (or in classes called by that Activity) are destroyed when the activity is destroyed. Specifically, I think I have read (although I can't now find where) that if the View uses a large bitmap member object then the Activity's onDestroy() method should be over-ridden and the bitmap should be explicitly recycled.Are there other objects that need to be destroyed or removed when the Activity is destroyed? What about Listeners? Is there a comprehensive tutorial or guide on this subject?
View 1 Replies
Apr 26, 2010
I want to hide my app screen and then when the user clicks on the app again, I want to bring it to the foreground , but I want the app to maintain the screen that was pushed to background. Is there any way to do that right now?.Because when I try to hide my app, the surface of my app is gettng destroyed and so when I try to relaunch the app a new surface is created and my app status is changing.
View 2 Replies
View Related
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
Nov 22, 2010
I have a very simple widget application which consists of a linear layout with a background and an image button. In the AppWidgetProvider on Update method, I register the click of the button to broadcast an intent. When the widget first loads, everything runs fine and the click is captured. The problem occurs when the screen is rotated, and the click is never captured again even if the screen is rotated back. What do I have to do to re-register the click when the screen rotates? below is some segments of code I am using.
AppWidgetProvider
@Override
public void on Receive(Context context, Intent intent)
{super.on Receive(context, intent);
if(intent.getAction().equals("test.CLICK"))
{Closemouthed(context);}}
@Override
public void on Update(Context context, AppWidgetManager appWidgetManager,int[] appWidgetIds)final int N = appWidgetIds.length;
// Perform this loop procedure for each App Widget that belongs to this provider for (int i=0; i<N; i++) {
int appWidgetId = appWidgetIds[i]; RemoteViews views=new RemoteViews(context.getPackageName(), R.layout.widget);
Intent click intent=new Intent("test.CLICK");
Pending Intent pendingIntentClick=Pending Intent.getBroadcast(context, 0, click intent, Pending Intent.FLAG_UPDATE_CURRENT);
views.setOnClickPendingIntent(R.id.change_mode, pendingIntentClick);
SetInitialLayout(context);
appWidgetManager.updateAppWidget(appWidgetId, views);}
super.on Update(context, appWidgetManager, appWidgetIds);}
Manifest
<receiver android:name=".Widget" android:label="@string/widget_name">
<intent-filter>
<action android:name="android.appwidget.action.ACTION_APPWIDGET_CONFIGURE" />
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
<action android:name="test.CLICK" />
</intent-filter>
<meta-data android:name="android.appwidget.provider" android:resource="@xml/widget_mode_switcher" />
</receiver
View 3 Replies
View Related
Apr 16, 2010
I have a widget on my home screen with several ImageButtons which have default background images. Through the configuration activity, I can change the image on any of the ImageButtons. The problem is that when the screen is rotated, the image on the ImageButton disapears and it changes back to the default image.
I don't know why this happens or how to fix it
View 1 Replies
View Related
Oct 26, 2010
The FAQ mentions a method of passing objects around activities. (It is not clear to me): "A HashMap of WeakReferences to Objects. You can also use a HashMap of WeakReferences to Objects with Long keys. When an activity wants to pass an object to another activity, it simply puts the object in the map and sends the key (which is a unique Long based on a counter or time stamp) to the recipient activity via intent extras. The recipient activity retrieves the object using this key.".................
View 7 Replies
View Related
Jun 3, 2010
Does this bother anyone else with a Moto Droid? Is there an app that has eluded my searches that corrects this?
View 11 Replies
View Related
Jun 15, 2010
I have an application that have a Google map on Google Android 1.5 since we have been working on the application for a long time, we are not in stage of upgrading to the newest framework, so we are using 1.5. Now, I have map locations that are dynamically generated and drawn on the map at run-time to visualize some streams, Up to this point the application is working fine, Now my problem is that I am trying to filter the objects ( addresses) to visualize only the on-screen ones. I do NOT want to visualize the addresses that are off-screen. The way I am trying to do this is to check the screen-coordinates of each object (address) before visualizing it, then it the coordinates (x,y) more than (0,0) and less than (320, 460). I should visualize it. I am trying to use this approach, but it is not working for some reasons, I have tried many posts but could not understand why, there must be something missing somewhere that I am not aware of.
View 11 Replies
View Related
Sep 21, 2010
Just a minor problem that maybe I just have a setting out of wack. I have ADW launcher installed, which may or may not be an issue. But the home screen(s) won't flip to the wide screen look when the phone is rotated sideways. All the other views i.e. settings, browsers, etc do this no problem, but the home screen(s) them selves are stuck in a portrait view.
View 4 Replies
View Related
Mar 19, 2009
Is there any way for an Android application to retrieve some sort of Collection object that contains references to all of the GUI elements which are currently on the phone's screen? This could be very useful for testing purposes and so on. If I have overlooked a well-known class or library, please let me know.
View 3 Replies
View Related
Jul 28, 2010
I'm using textview objects to hold labels such as Score, Level etc on my game screen but they don't seem to be displayed where I want them to be. I understand about view hierarchies (parents, children) and am using the gravity tags in the XML layout file but it doesn't seem to have any effect. Could someone just quickly provide a guide to positioning a textview object on the screen, and also linking it in the code so that its contents can be pro grammatically controlled (I believe this would by done via =(TextView) findViewById(r.id.resourcename))? Code...
View 2 Replies
View Related
Jun 15, 2009
I want to render 3d object on the screen. Before that I would like to compute the screen so that the rendered object can be given relative position. How that can be done?
View 2 Replies
View Related
Nov 2, 2008
I accidentally put two icons on the home screen that I don't need there. How do I remove them? I still want to remove the applications, just the shortcut icons.
View 2 Replies
View Related
Dec 7, 2009
When my application is uninstalled, the widget stays on the HOME screen and gives an error message "problem loading widget". How do I remove the widget when my application is uninstalled?Is there an attribute in the manifest that I am missing?I have tried asking on the Google Android groups, but they take so long to approve and then it get's lost with the 100's of other questions that are ask that get approved at the same time.I was sure that this would happen by default by the OS, but guess I was wrong.I am catching the "PACKAGE_ REMOVED" intent, and checking the "EXTRA_REPLACING" to make sure it's not a reinstall, but I don't know the actual code to use to actually remove the widget.
View 1 Replies
View Related
Oct 23, 2009
I have an activity which pops up a Dialog box, to get some text input from the user. The problem arises when you switch orientation. The Dialog disappears, so I have added code to set and check flags in the savedInstanceState, meaning that the Dialog is displayed again in these circumstances.I know when the window is going to be closed, but can't find a way of closing it manually. I open it with alert.show();but there doesn't seem to be any corresponding alert.destroy() method or similar.Any ideas how I can manually close the dialog box without user input?
View 3 Replies
View Related
Jul 13, 2010
I'm using advanced task killer to kill the tasks, and then it seems when i check back there are 12-14 apps open.It's destroying my battery. I used startup cleaner to clean up start up, hopefully that'll be useful. but i'm just trying to keep things as streamlined as possible, seems liek a lot of apps dont like to not be active
View 6 Replies
View Related
Nov 23, 2009
Is there a way to keep an Activity in memory after the user hits the back button on it?ActivitySearch is used frequently in my app, however after the user starts it up, then hits the back button, it's destroyed, and the next visit to it requires it be built from scratch again.If after its first construction, I could just request it be paused instead of destroyed on the back button, then I could reuse it. Is there a sensible way of doing this?The only way I could think of reasonably doing it is to combine ActivitySearch with ActivityMainMenu into a single activity, and simply switch views when the user chooses search, but this is probably a bad design.
View 6 Replies
View Related
Apr 27, 2009
I'm developing a game for Android. It's got a lot going on but is running reasonably smoothly. That is, of course, until the user touches the screen.While they're touching it, onTouchEvent is called (with action = ACTION_MOVE, x = 0 and y = 0) roughly once every ten milliseconds at what appears to be a fairly high priority, as it absolutely obliterates the framerate. As soon as the touch ends the framerate returns to its nice state.Has anyone encountered this? Is there a way to reduce the rate at which ACTION_MOVE events are generated, or to ensure that they're only generated when there is actual movement, or use a polling method that just gets the current location of the touch? Or even just a way to disable it entirely?
View 4 Replies
View Related
Jan 9, 2010
I read up on how Android handles "configuration changes" - by destroying the active Activity.The first question I really want to know from Android Team - why? I would appreciate an explanation on how the reasoning went, cause I dont get it =)In any case, the fact that it acts in that way puts us all, as I see it, in a world of pain.Lets assume you have a Activity which presents a number of EditText:s, checkboxes etc. If a User starts to fill that form with text/data and then changes orientation (or get a Phonecall), then all input the User made is gone. I havent found any way to preserve state. That forces us to make extremely painful coding to not loose all data.
View 3 Replies
View Related
Sep 7, 2010
running with the moto droid - since the latest update, my phone is chronically opening apps every few seconds and it is destroying my battery. before the update, i would have to kill maybe 3-4 apps over an extended period of time. now it takes about 1 minute and i'm killing 10-15 apps. any reason for this happening? how can i fix it? it's getting annoying when my battery life is terrible. i don't know a whole lot about the phone.
View 12 Replies
View Related
Oct 24, 2013
For some reason I'm having problems deleting the widgets by dragging them into the bin. 9 times out of 10, the rubbish bin refuses to appear when I long press on a widget.
Is there another way - eg some settings menus somewhere or maybe a file that I can edit.
I am rooted
Samsung GTi5500
Android 2.2
View 3 Replies
View Related
Jul 18, 2010
Ive done some searching and came up empty. I want to remove vanilla lock screen and re installing the htcsense lock screen. I tried just flashing a custom htcsense lock screen but that didnt work. I cant even figure out where vanilla lock screen is installed.
View 8 Replies
View Related
Apr 30, 2010
Had my desire a couple of weeks and it has started playing up.Whenever I try and open any app that uses 3d my screen freezes and the only way to reset the phone is by removing the battery.I've tried factory resetting the phone but the problem seems to be getting worse. Looks like it will be getting returned on Tuesday.
View 3 Replies
View Related
Apr 25, 2010
I have a rooted eris running "Eris_Official_0.8.1T2" rom. I have seen threads about how to change the boot logo/animation, but no one knows how to remove the animation entirely. I would like the verbose boot to display on start up if possible. Has anyone done this? I have seen something similar with the android on iphone(at 1:53 in the video)
View 1 Replies
View Related
Jun 10, 2010
I have now had 7 random crashes in two days and the only way I know to get phone back on is to take the battery out and replace it. When it crashes - the screen goes black, but the green alert light still flashes. Does anyone else have this or a solution? It is stock with just a few added apps from the market.
View 19 Replies
View Related
Aug 17, 2010
Running 2.2 from OTA when I take the phone out of a dock (Multimedia or car), the home screen has to rebuild it self. Meaning all the icons are slow to come back. think of it as on a windows machine Explorer dies and you have to do a start/run/explorer to get it back. Only difference i that this is automatic, just slow to get responsive again. Even swipping through the screen is slow at first. Is froyo, google's VISTA?
View 12 Replies
View Related
Mar 26, 2012
I have a Vivid. Google contacts are set to sync. I also my outlook contacts using HTC sync (or MyPhoneExplorer). I used to have ~1300 contacts in Google. I now have 16. Everytime I restore my contacts, they are soon gone. I made a google contact yesterday and it is now gone. The destruction seems to happen when I sync with outlook.
View 2 Replies
View Related
Apr 9, 2010
While starting my application I get the following warning in Logcat:
04-09 10:28:17.830: WARN/WindowManager(52): Exception when adding starting window
04-09 10:28:17.830: WARN/WindowManager(52): android.view.InflateException: Binary XML file line #24: Error inflating class <unknown>
04-09 10:28:17.830: WARN/WindowManager(52): at android.view.LayoutInflater.createView(LayoutInflater.java:513)
04-09 10:28:17.830: WARN/WindowManager(52): at .....
Splash is the image that is shown in the splash screen. I have those four folders with for storing drawables in my app:
/res/drawable-hdpi
/res/drawable-ldpi
/res/drawable-mdpi
/res/drawable-nodpi
the splash image has its own version in the first three of them and is displayed properly. Removing the src property from the ImageView removes the image but not the exception. I'm a little bit lost with where to look for the cause of the exception. I even don't know if this is really an issue in this layout file etc. How would you go about finding the cause for this warning?
View 3 Replies
View Related
May 9, 2010
I want to show an arrow that indicates the direction towards a goal, using the orientation sensor and current GPS position. Everything works well, except that I want to rotate the arrow image in my ImageView.
View 2 Replies
View Related
Nov 24, 2010
I need to put some text over an imageview.
CODE:..........
But this doesnt displays the text only the picture. And also I have to rotated this text. Is this even possible with TextView?
View 1 Replies
View Related