activity

Group games to teach computer programming (either functional or imperative)

(See end for summary of updated question.) I want to convey to groups of people (kids or adults) how a computer program written in a high-level language works, and what the relationship is of that program to the computer as a consumer device as they know it (a TV-like box that "does" typing and "internet"). I want to do it without comp...

How to disable orientation change in Android ?

I have an application that I just would like to use in portrait mode, so I have defined android:screenOrientation="portrait" in the manifest xml. This works ok for the htc magic phone. But I have a problem with the HTC G1 phone as i open the hardware qwerty keyboard (not the virtual keyboard). My activity stays in portrait mode, but se...

Indirectly extend Activity

For ease of use I want to extend an Android Activity with a certain class to give it extra functionality and then extend my main activity with that class e.g. class SuperActivity extends Activity { //Very nice extra functions } //Class defined in the manifest.xml class ApplicationActivity extends SuperActivity { //Start the app...

AsyncTask in OnCreate fails at runtime, how can this be avoided in Android?

Hi I have an activity that starts with an AsyncTask to check the connection to my servers api. Since this should not run in the UI thread i have made a AsyncTask for this. The problem is that is get an runtime exception when i start the background process of the Asynctask. How can i avoid this? From log: 10-12 14:18:56.476: ERROR/An...

Android, how to get information on which activity is currently showing (in foregorund)?

Hi, I wonder if there is a way to get information on which activity currently has focus (is in the foreground)? I am using instrumentation and I would like to know which activity is currently running in the application that I am testing against. Thanks ...

Android: Why shouldn't I use activities inside tabs?

I've read at a few places that I should not be using Activities as contents of my tabs. I would like to know why this is not a recommended approach... Any suggestions? ...

UML Activity diagram: decision branch ends whole activity

I was wondering if there is a way to depict that, on an activity that has a decision; one of the branches completely terminates with the activity. This would be similar to a subroutine just returning control to the invoker when a condition is met. sub activity() { ... ... if ( condition ) { ... } else { return;//...

[Android] How do I preserve a complex object across Activity restarts?

Say I have a Java Bean object which is serializable. I want to store it away safely when an Activity goes through onDestroy() on purpose (i.e. onSaveInstanceState() is not called). I am looking for a way which doesn't involve creating a database and write the object to that (mostly since a) Android's DB API is horrible and b) since data...

How to make an external library like the Mapping API on Google Android

Hi all, I am looking to create an external library for Android that essentially provides an Activity that others can inherit from and the base Activity takes care of all the basic visual user interface stuff. So, it would be like the Mapping APIs that Google provides. Ideally it would be included in the manifest file in a manner similar ...

Android "single top" launch mode and onNewIntent method

I read in the Android documentation that by setting my Activity's launchMode property to singleTop OR by adding the FLAG_ACTIVITY_SINGLE_TOP flag to my Intent, that calling startActivity(intent) would reuse a single Activity instance and give me the Intent in the onNewIntent callback. I did both of these things, and onNewIntent never fi...

[android] Activity group throw ActivityNotFoundException?

Hi, I want to change the current activity inside a tab in a tab activity, after some research, I know that I need to use activity group to go this. then I created a new class extends ActivityGroup with the code below: public class FavShop extends ActivityGroup{ protected void onCreate(Bundle savedInstanceState) { super.onCrea...

Overriding the Activity/Task behavior in Android

I'm writing a simple Android app, and I'd like better control over the navigation/relationship between the activities. I don't want my activities to act like android activities...I don't want them to stack up within the Task. I want one activity (let's call it MainActivity) to be the landing point and always be at the bottom of the sta...

Android - clear history when navigating between Activities

I have 3 Activities that my user continuously is looping through. When user is back to the main screen I need to terminate previous history so user cannot hit back button and end up on screen #2, what would be a good way to do something like that? BTW - I'm using 1.6 (API level 4) To reiterate - say I don't know or predict the path whi...

How do I launch the email app with the "to" field pre-filled?

I tried this code which I found here: Intent intent = new Intent(Intent.ACTION_SENDTO, Uri.fromParts("mailto", "[email protected]", null)); startActivity(intent); But I get a message on the screen which reads "Unsupported Action". Any ideas of how to get this working? Thanks! ...

Is it possible to launch an Android Activity from an AlertDialog?

I am trying to create a small pop-up in my Android application to let the user choose from one of many items, ala a ListView. I am hoping to make it show up as a translucent box that overlays on the screen, as opposed to completely occupying it like Activities usually do. One technique for doing this that I've heard is possible is to l...

Android - Activity from a service?

I am extending the IntentService class to run a background service on Android. The service starts after bootup immediately. I want to pop-up a user input box from this service periodically. So, I tried calling an Activity from the service, but it doesn't help. The dreaded box of Force Close appears and the service dies. Can anybody sugg...

hide app from activity monitor using objective c

hi, if i have an app written in objective c, is there a way to hide it from being shown in activity monitor? ...

Temporarily non-rotatable Android Activities?

Is it possible to make an Activity temporarily not rotatable (like, turning it on/off in code, not in the manifest)? One of my old apps crashes if you rotate while it's doing an HTTP lookup as the views are no longer attached when it returns. One of these days I'll fix it proper, but in the mean time it'd be useful if I could just make...

android window translucent

How can I specify programmatically the windowIsTranslucent attribute for an Window's Activity ? ...

Problem with system intents

I have a program that has a broadcast receiver that listens for Phone_State and then sends a user defined intent. Well, my problem is that the system also sends out an intent (the one that I am trying to replace with my program) So I am trying to find a way to CANCEL the systems intent. I have found that if i have a timer just wait for a...