I am using TranslateAnimation to move an object from 1 position to another.
startX = 1;
secondX = 100;
thirdX = 200;
but the animation doesn't save the new location of the object.
So when i call it to go to secondX it goes from 1 to 100.
then, when i call it to go to thirdX instead of going...
I open a new activity by calling startActivityForResult.
Inside my SecondActivity class i have an exit button, when the user clicks it i need to close the SecondActivity.
What method should i call to close SecondActivity?
I tried calling finish() and finishActivity() on my exitButtonClicked...
All i am trying to do is to get the position of an object on the screen.
so let's say i have a button, and i want to know the (x and y) of thi button
Thanks
Is there any way to clear an imageview?
Lets say i have an imageview which is already using a drawable image.
During run-time i need to be able to clear it.
and no i do not want to change the alpha or visibility of my image.
Thanks
it says "AbsoluteLayout is deprecated"
but the code works fine.
is there another way to do such a thing without getting this warning?
Should i ignore the warning?
AbsoluteLayout l = (AbsoluteLayout)findViewById(R.id.layout);
l.addView(myCustomButtonOnRunTime);
I have a socket running as a service.
It receive some data , and based on this data i need to update my gui, for example populate a ListView. but it doesn't work.
How can i use a handler here?
public void socketGotData(String message)
//this method is in my service
//it gets called when i get...
When my first Activity loads i create a service (Socket connection to my server), and this srrvice suppose to keep running while the app is running.
I navigate to other Activities, and I need to somehow get an instant of this Service class to call a method "sendDataToServer".
How can I access a...
I am trying to implement a class extending the application to keep my global variables. I get an error
public class MyApp extends Application {
public String username;
public String session;
public String key;
}//when debugging and trying to go through line 6 the debugger says...
I have a service running in the background. (A socket class)
When the socket receives message i need to access the Activity that is shown on the screen and update the gui, any idea how i can manage to get the Activity shown to the user?
Thanks.
public void socketGotMessage(String message)
{...
I am an iphone app developer, and i want to start with android.
Everything is different.
For example, I need to create an instance of a socket, and have it running through the whole program? Where do i need to create this instance of socket so that it runs all the time? In iphone there was...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.