activity

startActivityForResult to an activity that only displays a progressdialog

I'm trying to make an activity that is asked for some result. This result is normally returned instantly (in the onCreate), however, sometimes it is nesesary to wait for some internet-content to download which causes the "loader"-activity to show. What I want is that the loader-activity don't display anything more than a progressdialog (...

How do I get the value of the item selected in ListView?

I thought I could use the position int, but when I click on the item in the list view, nothing happens. Please help! ListView d = (ListView) findViewById(R.id.apo); ArrayAdapter adapt = ArrayAdapter.createFromResource(this, R.array.algebra, android.R.layout.simple_list_item_1); d.setAdapter(adapt); d.setOnItemClickListener(new OnIt...

log activity. intrusion detection. user event notification ( interraction ). messaging

Have three questions that I somehow find related so I put them in same place. Currently building relatively large LAMP system - making use of messaging(activeMQ) , memcache and other goodies. I wonder if there are best practices or nice tips and tricks on howto implement those. System is user aware - meaning all actions done can be bind...

Android force tab activity creation?

I have an Android application with a main activity that is the tabhost. I'm adding multiple tabs to the tabhost with an intent to several activities. My problem is that these activities are not created (onCreate is not called) until I click on the tab. This is a problem because I need to register broadcastreceivers: there may be broadca...

How can an Android Service know that its not bound to any Activities

I have an Android Service that I would like to keep running even after the last Activity has been popped off the stack, or the User has chosen to do something else. Essentially the Service is listening for changes on a remote server, and I would like to generate a Notification if and only if an Activity from the app isn't running(or vis...

Android - How to prevent the phone screen from turning on when volume or camera key is pressed?

I have an activity that shows up when the phone screen goes to sleep/turns off ie turns black. For some reason, the phone turns on when the volume buttons or the camera buttons are pressed. By turns on, I mean the screen wakes up or comes back from the black screen state. I've tried using dispatchKeyEvent(KeyEvent event) and the buttons...

Android Keep Activity from Dieing

The main Activity I use in my Android application uses a fair amount of memory, meaning that on a less powerful phone, it is susceptible to being killed off when not at the front. Normally this is fine, but it also happens when I am still inside my application, but have a different activity at the top of the stack (such as a preference a...

Loading screen in Android

What's the best way to create a reusable loading screen in Android? The loading screen should have a background image and a loading indicator. Should I use a separate activity? ...

Android Activity call another Activity method

Hello, A TabActivity start other activity when i click on a tab, How to send information to parent (tabActivity) and don't finish current activity? My tabactivity start another activity like this : mTabHost.addTab( mTabHost.newTabSpec(TAB_OPTIONS) .setIndicator(TabImgFond5) .setContent(intentOptions)); Inside my n...

Determine if a specific activity in an application can be launched...

Applications can have any number of launchable activities. I know how to get the list of these activities via PackageManager. Is there a way to determine which activities can be launched via startActivity? For example, the Documents To Go app has different activities that will start Word, Excel, Powerpoint, PDF, etc... I am able to l...

Can I have an android activity run only on the first time an application is opened?

OK, so I'm playing around with an android app. The 90% use case is that users want to go straight to the primary list screen to find what they're looking for. That's what I want as my default screen. The first time a user loads the app however, some configuration is required before their list screen is of any value to them. So my que...

Listing an application's activity and intent-filters?

I am interested in activating another application's activity. I know from reading the Android SDK that it's probably better to do this with an implicit intent. However, this activity doesn't reside in an application I own, so I don't know the action and category and data flags on the intent-filter. How can I examine an Android applicati...

Multiple listview in single Activity

Hi i have activity in my project which contatin below xml file But Problem is that when i run my activity it display lsitview only in some part of the screen. i want both listview scrollable and also the whole layout should be scrollable to anyone know how can i do this? Regards jay. ...

How are activities and views related in the Android platform?

I am attempting to learn how to develop on the Android platform but do not quite understand the relationship between Activities and Views, because according to the documentation an Activity is almost always linked to a UI object that the user can interact with, but if this is the case where does the whole idea of Views come in? There is...

How can I set an intent's class from a string value?

I am trying to set the class for an intent to the address listed in a string value, so that I can launch a given activity. The string is composed dynamically during runtime. Is there anyway to make something like the code below run: String target=com.test.activity1.class; Intent intent=new intent(); intent.setClass(this, target); Th...

Android Activities UI Persistence

I need to have two activities in an Android app that can be switched between each other with UI persistence as follows: Activity A launches Activity B. User triggers some UI changes in Activity B. Activity B returns to Activity A (by a call to onBackPressed() or something similar) Activity A re-launches Activity B. I would like the c...

Pass data from thread into Activity

Hi, I am want to pass data back from a Thread to Activity (which created the thread). So I am doing like described on Android documentation: public class MyActivity extends Activity { [ . . . ] // Need handler for callbacks to the UI thread final Handler mHandler = new Handler(); // Create runnable for posting f...

Return back to the parent activity from subactivity

My application supports twitter and needs to open browser for OAuth. When the user clicks the Share on Twitter button, the main activity will create another subactivity (TwitterActivity) to handle twitter authentication issues. Here is a flow graph showing how activities are invoked currently. Main is short for MainActivity and Twit for...

Detailed android activity lifecycle (onAttachedToWindow())

I'm interested in android activity lifecycle and I would like to get more detailed description/documentation/reference than widely available basic (onCreate->onStart->onResume) one. My need comes from realizing that starting new activity (Theme.Dialog styled) from onAttachedToWindow() greatly improves response time if comparing to star...

What happens to thread as onDestroy is called when device is rotated

I would like to know as to what will happen to the thread which has been created by an activity and the device is rotated. I have observed that the onDestroy method is called when this happens. Will the thread be killed too? If the thread is not killed, how can I reassociate the thread with the activity as a new instance of the activity...