activity

Declare Inner Activity In The Android Manifest

Hi In my thread I create an inner activity 'B' at one point in order to launch another activity for result. I need to declare this in my Android manifest file but can not work out what the name of it is as the standard ".B" does not work as it says that activity does not exist. How can I declare this activity? Thanks ...

Android: How to start an Activity from an alert dialog

I need to start an activity when the user chooses an item in an alert dialog. How do I get the context to pass to the intent constructor in the following code... builder.setItems(items, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int item) { Intent i = new Intent(<WHAT DO...

When switching tabs in Android, what does it constitute?

I have three tabs and each one is its own activity. When I switch tabs I want my Spinner to update but I don't know what method gets called on tab switch. Any help? ...

How to test multiple activities on Android

Hi Im trying to create some jUnit tests for my Activities. The main activity seems easy to test by extending ActivityInstrumentationTestCase2<Main> and when i click "Run..." the app and the tests are installed on the emulator and runs fine. I can see that the main activity is starting. The problem is that I can't figure out what I nee...

How to handle notifications in an Android Activity

I have an Activity that will query a RESTful API every x seconds (polls using a handler). The results of the GET are used to update a ListView. This is done using an AsyncTask. I want to put a Notification in the Notification bar when certain criteria are met in the new data. Everything I have read up to this point has suggested that...

Network connection lost every time an Activity is created?

I am checking to see if my app has a network connection: public boolean isOnline(){ ConnectivityManager conMgr = (ConnectivityManager)getSystemService(Context.CONNECTIVITY_SERVICE); if ( conMgr.getNetworkInfo(0).getState() == NetworkInfo.State.CONNECTED || conMgr.getNetworkInfo(1).getState() == NetworkInf...

Android: Modifying adapter content from a background thread

Hi, I've read up quite a bit on the exception thrown while using BaseAdapter, but i can't seem to find an alternative solution: Make sure the content of your adapter is not modified from a background thread What i want to achieve is to keep a copy of a message queue in memory, and use this message queue to populate the BaseAdapter for ...

In an activity diagram, are there two initiating events allowed?

Hello, I want to model an activity, where there can be two several initiating events. These events has two several responsible actors. Is it allowed that a UML activity-diagram could have two initiating events and only one end? Could the action-flow be joined? I want to know if I defy against the UML-modeling principles, if I do this. ...

Showing ActitivyIndicator when loading data

I have a TabBarApplication and in one view I load XML-data from an URL. When I click the tab which shows the view with the UITableView and the data received from the XML I would like to show a Activity indicator. What is recommended here? Should I push a view just for showing the activity indicator. Today I run the XML-parsing code in...

Starting new activity in the Android SDK

Hey, So I have this code in my main activity to start a new one: public class MainActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); findViewById(R.id.GoButton).setOnClickListener(new View.OnClick...

Basic doubts about how "organize" my Android code

Hello. Im starting my first Android project so im still kind of n00b and not sure about how to organize some things to have a clean code :P I have my first screen with a spinner and a button. When you click the button i catch the spinner selection and the app will move to a new screen (Depending on the spinner selection). So now, i ha...

How to send an ArrayList of custom objects in a Bundle

I have an application that uses a service to create an ArrayList of custom objects (MyObject) every x seconds. I then want my Activity to obtain this ArrayList. I'm currently planning on having the Service send a message to the Activity's handler every time it finishes the query for the data. I want the message to the Handler to conta...

Suppress notifications from a service if activity is running

I have an Activity and Service that work together in my application. I've configured the service as a remote service (implemented AIDL) so it will keep running even when the Activity isn't visible. The service is responsible for polling a server for data and sending alert notifications when certain criteria are met. I do not want the ...

Adding zoom out animation to the activity

Hi All, I have customized my activity to bring it like a dialog. Now I want to stop the default animation and have to add the zoom out animation. To stop the animation I have tried the following. customDialog.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION); and in styles <style name="Theme.CustomDialog" parent="android:style/Theme.D...

Activities Design in Android?

Hi Folks, Basically, we are maintaining the sessions for the specific user's environment. For that, Three basic stuff we have to maintain. That are Login, Session check and Logout. In Android, Each screen designed by Activity. we can startActivity() and finish() a current Activity. But you can not do that Previous Activity. UI Design ...

Android 2.1 CheckBox component : change check color

Hello, I'm developing a application for Android v2.1 and i seach how i can change the color of the "check" for a CheckBox component ? Thanks you in advance :smile5: Dominique ...

Android Share an Image, Process in Background (how do I run the activity in the background?)

I've written an application which adds itself to the image gallery [Share] menu. When the user clicks my app, it uploads the image to a hardcoded web service. It's all working great, but there's one tweak I can't seem to figure out. When the user selects my app, the Gallery "flashes" away for an instant while the Android Activity is...

Service and activity communication

I am making a IM client for android and i want to know how to do the communication between a Service and Activity. I have a Service that establish the connection to gtalk, gets the contacts, listens for the incoming messages... , and i have the activity that is the UI of my application. In the activity i create the service and bind th...

android startActivityForResult is killing a thread within the parent activity

Hi, I have an activity which has a thread and a view in it...they're suspiciously similar to LunarLander. To show an in-game menu, i'm calling the startActivityForResult for a different activity which has a number of buttons on it...this is then returning the button type pressed to the parent activity. This is fine except when I carry on...

How to use Service Discovery in a code activity ?

I am trying to write a code activity which uses service discovery to locate a discoverable service. I created a service contract and config file for the service using svcutil. Then I added the generatedproxy.cs (this is the name i gave to it) and app.config files to my code activity project. I am using the following code in the code acti...