Tag: android-activity

slide out animation not working on back press button?

I am using animations when entering or exiting the activity,entering to an activity animation works fine but exit animation does not work well. I start exit animation when i press back button.What happens is it first start enter animation for current activity then show the last activity what i want a simple exit animation on […]

Activity that is only launched once after a new install?

I want my app to have an activity that shows instruction on how to use the app. However, this “instruction” screen shall only be showed once after an install, how do you do this?

call custom Activity as startActivityForResult

I am starting an Activity for result as startActivityForResult(new Intent(this,ActivityA.class),REQUEST_CODE) ActivityA is started. There is a gridview on ActivityA, I want to get the position of selected image in method onActivityResult(int requestCode, int resultCode, Intent data) of caller Activity but I am not getting the way to do that

Android Multi-Screen Application

How do you handle multiple screens in an android application? I have developed with the tab bar at the bottom without problem, however what I am wanting to do is replace all the content on the screen with the content from a new .xml layout file I have created in the project. Additionally, how would […]

Move an Image in circular path in android

I am having an Image, I wanted to move it in circular path onClick() event of button without animation, I don’t know how to do it.. Any help?? This is my main class public class MainActivity extends Activity { MyAnimation animation; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); animation =new MyAnimation (); } and […]

Android – switch to activity without restarting it

I am programming a chat program for android. I have the contact list as one activity and the chat windows as a second activity. I use startActivity to switch to the chat activity, but the chat activity gets reloaded every time. Therefore the screen gets cleared. Is there a way to switch to a running […]

How to make an activity window stay always on top

I want to create an activity that stays always on top (like the modal windows or task manager in Windows) of the others activities. How can I do this on Android? Thanks

How to send data to a running activity from Broadcast Receiver,

I am able to receive C2DM message fine but I want to send the data to a running activity, i.e when the activity is running, if the receiver receives C2DM message it is to send the data to the running activity. The code of receiver is (no bugs in the code): public class C2dmreceiver extends […]

Activity with a transparent background

I’m creating a reusable Loading screen to use between Activities, on the LoadingActivity I added a semi transparent background resource, but I’m unable to see the old Activity. public class LoadingActivity extends Activity { public static int REQUEST_LOADING_SCREEN = 40; @Override protected void onCreate(Bundle savedInstance) { super.onCreate(savedInstance); FrameLayout mainLayout = new FrameLayout(this); mainLayout.setBackgroundResource(R.drawable.background_translucent); LinearLayout layout […]

Android Context without being in an activity? And other activity-less programming?

I’ll try really hard to turn this into one comprehensive question: I’m writing a method to get a String that contains the name of an Android device’s city, as determined by the LocationManager and getLastKnownLocation() and all that. Then I realized I’d need to do the same thing again in another activity, so why not […]

Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.