activity

Listen to ActivityManager events?

Hi, is it possible somehow to listen to the events of the ActivityManager, e.g. when activities are started? Does the ActivityManager send broadcasts? I havn't found anything indicating that it does. What I basically need to do: I want my app to launch one of my activities whenever a certain (thirdparty) app is launched/takes focus. Pr...

Android - Using method from a Service in an Activity?

I have the folowing method in a Service in my appplication: public void switchSpeaker(boolean speakerFlag){ if(speakerFlag){ audio_service.setSpeakerphoneOn(false); } else{ audio_service.setSpeakerphoneOn(true); } } So my question is whats the best and most effective way to be able...

Is this the correct way to start an Activity?

Intent nnn = new Intent(Hello.this, NewActivity.class); startActivity(nnn); finish(); This would start a new activity, and then close the current Activity forever, right? ...

Opening dialog activity on creating another activity

Hi, I've got an activity, call it A, that when initially opened I would like to programmatically open a another dialog theme activity, B, over the top. The user would select some info from the dialog activity and return to activity A. When resuming to activity A at some later point the data set would be available, so the dialog would ...

Re-use previous activities?

I have activities that are create and launched from menu options. However Ive noticed that this may mean that sometimes there are two or more copies of the same activity. So Im wondering if there's a way to see if another activity is already instantiated and then have the application switch to it or create a new one if its not instantiat...

App always starts fresh from root activity instead of resuming background state (Known Bug)

I am facing exactly the problem mentioned in these links: http://code.google.com/p/android/issues/detail?id=2373 h**p://groups.google.com/group/android-developers/browse_thread/thread/77aedf6c7daea2ae/da073056831fd8f3?#da073056831fd8f3 h**p://groups.google.com/group/android-developers/browse_thread/thread/2d88391190be3303?tvc=2 I hav...

How does a Service communicate with its Activity? How can a Service call a method in the Activity, which started that Service?

Suppose I have an Activity that's a list. It calls a Service when this Activity starts. The Service will do background stuff--download, parse, and fill the list. My question is this: How can the Service communicate with the Activity? How can I call a method in the Activity, from the Service? (I'm new to OOP) The Service is started lik...

How do I bind this service in Android?

This is the code in my Activity. Initiate an Intent, then a Connection, right? hello_service = new Intent(this, HelloService.class); hello_service_conn = new HelloServiceConnection(); bindService( hello_service, hello_service_conn, Context.BIND_AUTO_CREATE); But my question is...what goes inside the Connection? class HelloServiceC...

Is it possible create an output property to show endtime on custom activity properties when activity completed

when do the custom activity in .net 3.5, I tried to add a datetime property to show user when the activity completed, however as this property will be assigned value during workflow runtime, it cannot been show up the value to user, do you guys have any idea? ...

I have one Activity. In this Activity, I executed a AsyncTask , but it's not working.

private class ExecuteLocations extends AsyncTask<String, Void, Void>{ private final ProgressDialog dialog = new ProgressDialog(ListProfiles.this); protected void onPreExecute() { //this.dialog.setMessage("Starting pre-execute..."); //this.dialog.show(); } @Override protected Void doInBackground(Strin...

Android - Should I use multiple activities or multiple content views

Hi, i'm new with android. I'm working on an application using xml layouts. I wish to know which is better: 1. Use few activities and change its contentview 2. Use an activity for each 'view' needed If both works, in which case which option would be better? thx a lot ...

Which activity handles Intent.ACTION_CALL_PRIVILEGED?

I've been digging for awhile into the source of the Contacts app on Android to find out which Activity handles Intent.ACTION_CALL_PRIVILEGED. Unfortunately, I couldn't find its source code. Does anyone know how it's called, or even better where I can find it's source? Thank you! ...

Android Instrumentaion: How do I go back to a previously launched Activity?

Hello, I'm currently running automation tests using an app that uses multiple Activity for displaying each screen. Is there anyway to go back to a previously launched Activity while running an Instrumentation test? Currently, when I use sendKeyDownUpSync( KeyEvent.KEYCODE_BACK);, this forces my test to exit, rather than go back to the ...

Using the camera activity in Android.

If you want to use the built-in camera activity which uses the native Android camera, simply do the following. Intent camera = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); this.startActivityForResult(camera, PICTURE_RESULT); You want to get the images back from the nifty camera you displayed, and here's how: If you want to...

how to check internet conection in android?

dear friends, i want to check internet connectivity in each activity if lost then it should display a message. can any one guide me how to achieve this? any help would be appriciated. ...

Android - Make sure activity is alive before firing Intent?

Hi all, I am currently firing an Intent to a Broadcast Receiver which in turns starts an Activity. Then from the same Service another Intent is fired to a Broadcast Receiver thats in the Activity. The problem is that the Activity isn't getting the Intent meant for it because it is fired before it is alive and the Broadcast Reciever is...

How do I use the android media services to return that media to my activity?

Hi! I'm interested in capturing media to use in my activity in two ways: 1) capturing immediately from the supplied app. (like http://stackoverflow.com/questions/2314958/using-the-camera-activity-in-android) Intent camera = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); this.startActivityForResult(camera, PICTURE_RESULT); 2...

how to show Progress control or gif in android?

dear friends, when i call webservice on clicking button it waits to load records on new activity and shows activity blank during that time period can any one guide me how to show progress during that time period? any help would be appriciated. ...

How do I create a gauge in Android?

I'm looking for a view that I can put on an activity that displays as a gauge, with tickmarks, and allows me to set a value to change where the needle is pointing. Just like a speedometer! Thanks! ...

Best way to add Activity to an Android project in Eclipse ?

When adding an activity to an existing Android project, I manually create a new class - is that the best / preferred way? How do others handle that? ...