Top "Android-activity" questions

Questions about creating or managing Activities in Android.

How to change title of Activity in Android?

I am using Window w = getWindow(); w.setTitle("My title"); to change title of my current Activity but it does …

android android-activity
getApplication() vs. getApplicationContext()

I couldn't find a satisfying answer to this, so here we go: what's the deal with Activity/Service.getApplication() and …

android android-activity android-service android-context
Finish all previous activities

My application has the following flow screens : Home->screen 1->screen 2->screen 3->screen 4-&…

java android android-activity screen flow
How to restart Activity in Android

How do I restart an Android Activity? I tried the following, but the Activity simply quits. public static void restartActivity(…

android android-activity
How to get current foreground activity context in android?

Whenever my broadcast is executed I want to show alert to foreground activity.

android android-activity
How to return a result (startActivityForResult) from a TabHost Activity?

I have 3 classes in my example: Class A, the main activity. Class A calls a startActivityForResult: Intent intent = new Intent(…

android android-activity android-tabhost
Example: Communication between Activity and Service using Messaging

I couldn't find any examples of how to send messages between an activity and a service, and I have spent …

android android-activity android-service
How to show a dialog to confirm that the user wishes to exit an Android Activity?

I've been trying to show a "Do you want to exit?" type of dialog when the user attempts to exit …

android android-activity android-dialog activity-finish
Start service in Android

I want to call a service when a certain activity starts. So, here's the Service class: public class UpdaterServiceManager extends …

android service android-activity
Android: How can I get the current foreground activity (from a service)?

Is there a native android way to get a reference to the currently running Activity from a service? I have …

android service android-activity