Android :: RotateAnimation - Stopping And Starting Again After Every Rotation
Mar 29, 2010
I am rotating a view using rotateAnimation with this code new RotateAnimation(0, 360, w / 2, h / 2); I want to rotate this view infinitely, so i put setRepeatCount(RotateAnimation.INFINITE);
But the problem is after every one complete rotation, its stopping and starting again, means by default rotateAnimation have AccelerateDecelerateInterpolator(). I feel because of this. So if i put setInterpolator(null), its throwing null pointer exception. How to solve this.
I want to rotate my view without any lag.
View 4 Replies
Aug 14, 2010
I have a service running (Socket), this is how i start the service.
CODE:.......
But this doesn't seem to stop my service? Am i missing something? I need to destroy my service as soon as the home button is clicked.
View 1 Replies
View Related
May 13, 2009
To support usability studies on what applications are used, i want to write a service that logs when an activity is started and also when it has finished. This is to understand how the users are using the device:
One straightforward option is to have the applications modify, to write this out. But this is tedious having to modify all applications and will not work esp with third party or built in applications.
Is there any alternatives that makes this simpler and easier?
BTW: Looking at the android framework source ActivityManagerNative seems to be invoking a Binder interface when an Activity is started and finished. Any information on what this service is? Is this something i can tap into?
View 8 Replies
View Related
Oct 28, 2010
I have a Service which tracks the location of the user. Currently, the Service boots when the application starts and stops when the application terminates. Unfortunately, if users keep the application in the background, the Service never stops and drains battery.
I would like the Service to stop when my application is not in the foreground. I was hoping the Application class would let me Override onPause and onResume handlers, but it does not have them.
View 1 Replies
View Related
Jan 20, 2010
I have one simple question regarding Java TimerTask. How do I pause/resume two TimerTask tasks based on a certain condition? For example I have two timers that run between each other. When a certain condition has been met inside the task of first timer, the first timer stops and starts the second timer, and the same thing happens when a certain condition has been met inside the task of second timer.how do I pause timer1 while running timer2 and vice versa while timer2 is running? Performance and timing is my main concern as this needs to be implemented inside another running thread. By the way I am trying to implement these concurrent timers on Android.
View 4 Replies
View Related
Jul 13, 2009
I'm writing a game using the drawing method from Chris Pruett's opengl spritemethodtest demo. The Activity running my opengl view works fine on initial load, and about half the time after turning off the phone and turning it back on. However, the other half, it locks up. I'll get a "lock_layer timed out (is the CPU pegged?)" warning that keeps repeating. I tried running the debugger to find the exact line that the error is occurring on, but the strange thing is that this error won't occur if I'm running the debugger on my G1. It only happens under normal operating conditions. Any help would be appreciated, as this bug really has me stumped.
Here are my onPause and onResume activity methods:
CODE:.............
Here's a stack trace, running from the initial onCreate call to the lockup (I added some extra Log warnings to illustrate when different lifecycle methods are being called):
CODE:..................
View 2 Replies
View Related
May 8, 2012
I have an Acer A100 tablet that I've upgraded to ICS (the upgrade went very smoothly, by the way). But under both ICS and the original Honeycomb, the Android OS has an annoying habit of starting a bunch of apps automatically. Facebook, Google Maps, media players and a whole host of apps that I do NOT want to start all by themselves. I found an "Advanced Task Manager" that will check every 5 minutes and kill unwanted apps automatically. But every time I check it there are still half a dozen apps running in the background that I don't want.
If it were just one or two apps, I would simply uninstall them. But it seems like half the factory apps are intent on restarting themselves no matter how many times they're turned off. My Acer has a very small battery, and I suspect I'd get much better battery life if it would only run the apps that I start manually.
Other than email and the system update manager, I really don't want any apps running in the background. And when I turn an app off, I want it to stay off until I restart it. Is there a way to edit the list of programs that start automatically? Do they all have to be disabled individually? I've checked a few of the apps, and don't see any way to disable the "automatic log-in", "check for new data" or whatever each program might call it's annoying insistence on starting whenever it wants to.
View 3 Replies
View Related
Oct 6, 2009
Have a question regarding RotateAnimation. If I do not set the property FillAfter to true then the image in my view, that I use RotateAnimation to animate, returns to the initial position after the animation is done. My problem is that when I set fillafter to true when I later set the image on my imageview to another image than the one I animated some kind of transformation is applied to that image also.
View 2 Replies
View Related
Apr 5, 2010
I have a AppWidget, after I delete it from HomeScreen it seems not stopping the AlarmManager attached with it. I have supported it with the AlarmManger, that call the ProviderImplementation class every 1 minute and in onReceive I put the code to call onUpdate. and in onDelete I explicitly stop the alarm, but it seems it is running continously and not stopping. any cure of it ?
I have stopped it with cancel(pendingintent) function.
View 2 Replies
View Related
Jun 7, 2009
My appWidget is working well. When it's installed and used by user, a Thread is launched to refresh view (like a flipper). Even if the screen is off, the thread is continuing...perfect for me... But after 3 minutes, it's stopped.
Does it a VM restriction avoiding some bad development usage?
How can I use this type of service? Develop a service in place of my thread?
View 3 Replies
View Related
Jun 22, 2010
can someone help me.. i want my service to start as soon as the device starts and also the service to persis and remain started.it should destroy only when device switches off.
View 4 Replies
View Related
Oct 19, 2010
When the GC kicks in during my game I sometimes get a noticeable framerate drop, which is to be expected.Is there any way to get more info as to what is causing this? I.e. what in my code is causing the GC to kick in.
View 10 Replies
View Related
Aug 19, 2010
I have both ADW and LP on my Droid. If I go into Settings/applications/ manage applications and select a launcher (that has widgets) and use the force stop option on the launcher, will the widgets set up with that launcher continue to run? Or would they be stopped as well? Would it matter if bother the running and stopped launcher had some of the same widgets?
View 1 Replies
View Related
Jun 25, 2010
Is it possible to stop an Android app from the console? Something like: adb stop com.my.app.package
It would speed up our testing process so much. Right now we uninstall/install the app each time to make sure the manual test cases start with a clean state.
View 2 Replies
View Related
Jul 30, 2009
My service spawns a new thread, and stops it according to the typically recommended java method of interrupt()'ing. When I stop the service, I stop the thread in onDestroy(). The service is stopped, and the interrupt code is reached. However, soon enough the thread restarts from the beginning of the Runnable.code...
View 3 Replies
View Related
Jun 18, 2010
I've installed Last.fm onto my desire for streamed music but I've noticed that it only plays 3-4 songs on average before stopping. the screen goes black which I guess means that it's going into sleep mode.
View 4 Replies
View Related
Oct 21, 2009
The Content Provider starts when the first applicable URI is resolved. This will make the ContentProvider run forever and there doesn't seem to be a way to stop it (such as due to inactivity etc).It would be nice if Content Provider would stop after some time so that the memory usage is reduced (An enclosing process, doesn't need to be alive if the Content Provider is not needed anymore).
View 4 Replies
View Related
May 6, 2010
I want to stop an Activity that is in some other application from my Applications service. Is there any mechanism to do so?
View 6 Replies
View Related
Jun 3, 2010
I'm having trouble getting my widget to stop hogging so many resources.I setRepeating on the AlarmManager to update. When the widget is deleted (onDisabled()), I call .cancel() on the service, but the service still shows up in the android "running processes" making me believe I'm doing something wrong.Also, should I be scheduling my updates in the onEnabled() or the onUpdate()? onUpdate doesn't seem to work on anything other than the first widget.
View 1 Replies
View Related
Jun 30, 2010
I have an Android Service that is started by my application and does some things in a threadPool using Executors.newCachedThreadPool()
Once it has finished doing it's work I would like the service to stopSelf(), how can I get the service to determine when it is no longer needed (ie, there are no more Threads executing) so that it can shut itself down automatically?
View 1 Replies
View Related
Apr 22, 2010
I have this problem, I have some audio I wish to play. And I have two buttons for it, 'Play' and 'Stop'.Problem is, after I press the stop button, and then press the Play button, nothing happens. -The stop button stops the song, but I want the Play button to play the song again (from the start) Here is my code:final MediaPlayer mp = MediaPlayer.create(this, R.raw.megadeth);And then the two public onclicks: For playing)
button.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// Perform action on click
button.setText("Playing!");
try {
mp.prepare();
} catch (IllegalStateException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
And for stopping the track
final Button button2 = (Button) findViewById(R.id.cancel);
button2.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
mp.stop();
mp.reset();
Can anyone see the problem with this? If so could you please fix it. (For suggest)
View 3 Replies
View Related
Sep 14, 2010
How can I identify and stop single running services? More specifically, once I got the running services on a List as in a chunk of code like:
ActivityManager activityManager = (ActivityManager) getSystemService(ACTIVITY_SERVICE); List<RunningServiceInfo> services = activityManager.getRunningServices(Integer.MAX_VALUE);
Is there any method to stop a single service, i.e to identify one and then stop it?
View 3 Replies
View Related
Mar 3, 2010
I'm trying to prevent my application to call the same method twice in the event of a double-click, or if the user presses different buttons quickly, almost at the same time.I have clickable Views, acting as buttons, that call the same method but passing different parameters.Inside this method I'm creating a new Thread, because it queries a web server for the result.The problem is that upon two quick clicks, the method is fired twice, two threads are created, and consequently two new activities are created. That makes my app crash.But this only seems to work on slower phones like the G1, I tried on Nexus and before it set blocked = true, the second request has was granted. So is there any way I can block the method being called if it's already running, or if the thread has started so it wont create a new one.
View 3 Replies
View Related
Jan 19, 2010
Is there any way to stop the Weather Chanel from broadcasting alerts. In San Francisco, wind and rain, constitute alerts. So this week there's a new alert every hour or two. I know it's raining and I know it's windy. It seems to be draining the battery.I've looked in the menu but I can't figure out how to stop the alerts from waking up my phone all the time. Any suggestions other than uninstalling?
View 1 Replies
View Related
Feb 28, 2009
In my game, I've got one activity starting another activity via an intent. When the user is finished with the second activity, they quit it using the back button. However, I have a problem: when this happens, the second activity is still running, even if it's quit with the back button.
My second activity will eventually give a "game over" message using a pop up window if there is no user input for a period of time. Problem is, when I back out of the second activity (where the game is happening) the "game over" message still appears eventually. This is how I know the second activity is still running. It even displays a "game over" message if my entire app is quit (on the Android OS).
How do I stop an activity completely when the user presses the back button?
View 3 Replies
View Related
Mar 17, 2010
My application uses GPS updates while it is running and I would like that to stop when the user back out of the app as I assume it will continue wasting a lot of battery power. I've tried intercepting the back button press but it doesn't seem to work. I'm not sure if this is because it's not executing the code or I'm using the wrong command.
CODE:.....................
View 1 Replies
View Related
Oct 19, 2010
I'm trying to help someone who'd like a way to stop email spam from reaching his Android phone. I understand this is usually best done from the email server side of things, but this is where we are right now. This is regarding his work email, and I've suggested that he have gmail fetch it for him so they can filter it (does this work for fetching? I know it works great for emails sent directly to gmail), alas, he says he only has an imap server and no Pop3 server for gmail to fetch. I looked in the market and found only one not terribly highly rated app for filtering email spam on Android phones. If you've tried that email filtering app, it worked?
View 11 Replies
View Related
Jul 17, 2010
I've built the bare bones of my app so far in Eclipse using an adapted version of the LunarLander app provided by Android Developers. I've adjusted bits and pieces and have no errors at all though when I run it in the emulator it keeps saying "the application has stopped unexpectedly" and i have to Force Close.
Is it possible that my main.xml layout file is causing this issue? Mine looks like this:
CODE:..............
But their's looks like:
CODE:.............
Could this be responsible for the app being unable to launch? If I need to post my code I will but its over 900 lines so thought I would just see if this was possibly the problem first?
View 1 Replies
View Related
Jan 9, 2010
I am facing a problem with a stopping thread which is in a synchronized block. I am using TCP socket. The problem is that I am waiting on a DataInputStream object and I want to create a new socket again but it doesn't allow me to do because of the synchronized block.
I have tried with Thread.interrupted(). I cannot avoid the synchronized block. Is there any other way to do the same?
dis = new DataInputStream(ReadWriteData.kkSocket.getInputStream());
int i = -1;
String aval = ""; //new String();
char c = (char)dis.read();
It is getting blocked on dis.read().
What I should do for escaping the dis.read when I want to create a new socket?
View 3 Replies
View Related
Feb 8, 2010
I have a problem with rotation, during my ListActivity is loading data from the network. To do it I use a background thread which recovers data and put them inside an ArrayList. While this thread works, there is Progress dialog activated in foreground. For the rotation I use the method with onRetainNonConfigurationInstance() to save my ArrayList's state. After android calls this method, I call dismiss() on the progress dialog on onStop(). Then the activity is created as new with onCreate(), but it use the getLastNonConfigurationInstance() to recover the ArrayList's state. Now, my problem. If I rotate from portrait to lanscape when the download is terminated and I see the data in portrait yet, everything is ok. If I rotate during progress dialog is showing I have two cases: 1- onRetainNonConfigurationInstance() saves the arraylist fully recovered, the thread terminates and everything is ok. 2- onRetainNonConfigurationInstance() saves the arraylist empty, i think the download isn't finished yet. The onCreate is called and my list is empty, the thread terminates, but i don't see anything in my list. If I am in this case and I still rotate from landscape to portrait now I can see my list full with all the data. Why? Where am I wrong?
View 7 Replies
View Related