Android :: How To Determine If Activity Is On Screen?
Mar 4, 2010
I am planning to have a Service send a broadcast which a BroadcastReceiver will act on and I would like it to create a Notification if an application is not currently on screen, but if the application is on screen (ie. showing to the user) then I would like to offer a Dialog and not create the Notification.Is it possible to determine if an Activity or application is currently on screen?
View 5 Replies
Jun 9, 2010
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 launch all o these just fine.
However, it also contains some activities that I am not able to launch with startActivity... If I attempt to do this I get a SecurityException.
I want to be able to determine which activities I can safely launch and which I cannot so I only present the user with a list of activities that I can safely launch from within my application...
View 1 Replies
View Related
Aug 16, 2009
I want my background service to determine the active package or activity running.Is this possible?
View 4 Replies
View Related
Feb 19, 2010
I want to do some data processing (in a thread) right after my main Activity starts. For that data processing to be started I also need to know a visible size of my main View (which is a LinearLayout currently, but whatever).I wonder how to do that. I.e. I wonder what is the entry point (callback?) I should use to be sure that my main View has been layed out, so i can use view.getWidth/getHeight? Is creating a custom View and reimplementing it's onSizeChanged() - the only way? In this case how should I properly describe it in my xml layout file? (it will contain some child views)
View 1 Replies
View Related
Feb 3, 2010
I need to know exactly how big the screen is on the device in real units of length so I can calculate the acceleration due to gravity in pixels per millisecond. Is there a method somewhere in the Android API for this?
View 2 Replies
View Related
May 4, 2010
I need a system to determine if my application is visible on screen. My app is running gps, network request, etc ... and I want to disable them when my app is not running or visible on screen
Do you know how to do that?
View 4 Replies
View Related
Mar 3, 2010
example scenario is: from login screen - main screen - then when i clicked a hide button inside the mainscreen, the app will need to go in the home screen, and when im going to click the app again the main screen would be called and not the login screen
View 3 Replies
View Related
Mar 3, 2010
example scenario is: from login screen - main screen - then when i clicked a hide button the app will go to home screen, and when im going to click the app again the main screen would be called.
View 2 Replies
View Related
Nov 2, 2010
I have a TabActivity, and each Tab corresponds to its own Activity. In one of them, in the onCreate method, I use startActivityForResult to show a dialog (specifically, Bump's BumpAPI activity).
code:...............
The problem is that when the screen orientation changes, it tries to create the tab's activity again which makes another BumpAPI dialog, resulting in multiple stacked on top of each other. Do I have a hook into the started activity to cancel the previous one when the orientation changes?
A workaround seems to be to add a button that when clicked, starts the second activity, but that adds an unnecessary step.
Also, I can't fix the screen orientation for the entire tabActivity because some of them require typing and users may want to use their physical keyboards.
View 1 Replies
View Related
Jul 16, 2010
I used Toast to make notification, but it seems it will appear even its activity is not in the current screen and some other activity has been started.I want to check this situation, when the activity is not the current one, I'd not send the Toast notification. But how to do ?
View 1 Replies
View Related
Jul 1, 2010
I have a service that is listening for some events. When that event happens, it fires a screen by start Activity(intent) When the user finishes doing something on that screen, the code calls finish() but instead of 'closing' the complete application, is shows the main/launcher activity. any way to go around this?
View 1 Replies
View Related
Jul 15, 2010
i want to create a bitmap of whats being currently displayed of my app, one thing i went into is cant read FB buffer requires root, would like to know if it is possible to create a image file for the screen, please i want the help to code this, no 3rd party intents.
View 2 Replies
View Related
Nov 3, 2009
what i wont for example my g1 is Orentation enable and when my app start with screen rotate 90 then should be no rotating you know help me exam code pls.
View 2 Replies
View Related
Mar 9, 2010
I want to run an activity without ANY screen output. The screen should not blink or anything. How?I have an Appwidget. whenever it gets clicked I want to write something to a DB.So, via 'setOnClickPendingIntent' I start an activity that does that and finishes. But, the screen goes black for a short time, while the activity is running. How can I avoid that? Omitting 'setContentView' does not help, neither does a layout without any views. A service instead of an activity could do that, but I cant start a service by setting a 'setOnClickPendingIntent' (or can I?).
View 13 Replies
View Related
Aug 14, 2010
I'm writing an Activity that should take up the entire screen.What happens is that the window title and notification bar are both visible for just a moment when the activity starts up. Then they slide off, leaving my activity with a messed up layout: a blank space the size of the notification bar gets left at the top of the screen, and a little bit of my layout gets cut off at the bottom of the screen.It appears that it's laid out the activity the size of the full screen, but then pushed it down a bit so part of it gets cut off.If I remove either one of the two lines above, everything works correctly and nothing gets cut off. But then I have a title bar or notification bar at the top of the screen, which I don't want.
View 5 Replies
View Related
Mar 22, 2010
Can I have two ListViews on a single ListActivity? I have built the xml file easy enough, but the code around ListActivity, setListAdapter(), getListView() and the like, all seem to be designed around one ListView per activity. How to get 2 ListViews in one screen?
View 3 Replies
View Related
Sep 30, 2010
How do you set/pass values from one screen (activity) to another? What I have in the R.layout.main view labeled Calculator contains the code for doing calculations. The main.xml contains the layout (view) of the main screen. I have created an options menu which has another screen which shows you setup (R.layout.setup). The dialogsetup.xml contains the layout (view) for it.
When you press the menu button, you get the options menu. If you select "Setup", then it will display the setup screen. Now what I need to do is take the values from the setup screen (radio button and text values) and place them in the main screen so that when you exit the setup screen and go back to the main screen, you can take those values and use them in your main code.
View 12 Replies
View Related
Jul 1, 2010
I'm currently developing my first android app, and my first game. I've been developing on a netbook with a CliqXT (HVGA). Things are going well, it renders perfectly on the smaller screen. I knew I'd have some issues when rendering on larger screens, but the issues I'm having are not what I was expecting and I'm kind of stuck.
So basically the game consists of a main SurfaceView which I'm rendering the tiled game world on to. I followed this tutorial to get started, and my structure is still pretty similar except that it calculates the boundries based on the player location:
http://www.droidnova.com/create-a-scrollable-map-with-cells-part-i,654.html
The game also has various buildings the player can enter. Upon entering it launches another activity for that particular building. The building activities are just normal Views with Android UI stuff defined in XML (Buttons, TextViews, etc).
What I expected to happen:
So I expected the the building UIs to render correctly on the larger screen. I specified all dimensions in "dp" and fonts in "sp" in hopes that they'd scale correctly. I expected the actual game tilemap to render generally correctly, but maybe be really tiny due to the higher resolution / dpi. I'm using a very similar function to the tutorial linked above (calculateLoopBorders(), my version is pasted below) to calculate how many tiles to render based on screen height and width (getHeight() and getWidth()).
What is actually happening:
The whole game is just being rendered as if it's HVGA. The tilemap, and the building UIs are just scaled down to the smaller screen size, leaving black borders around the left, right, and bottom (see images).
View 2 Replies
View Related
May 14, 2010
I would like to perform an activity at the key guard screen, but the only way I can find to do so is to disable the key guard, do my activity, then re enable the key guard. This would be ok if it didn't cause the key guard screen to flash off and on (disable makes it disappear then re enable brings it back). I am wondering how I can perform an activity with it still being displayed? Kinda like how when the alarm goes off it shows a pop-up which is displayed over the key-guard screen?
View 1 Replies
View Related
Aug 16, 2010
I know on screen orientation changes activity restarted, but suppose i don't want to restart the activity then what should I do? I had tried it by adding in manifest.xml. android:configChanges="keyboardHidden|orientation"
and override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); }
But still activity restarted each time when I change screen orientation.
View 17 Replies
View Related
Apr 22, 2009
Is it possible to get listed the apps or activity which are actually displayed on the screen of the android mobile. I need to display a text box on some event when no acitivity is displayed, excepting the home screen.
View 3 Replies
View Related
Apr 23, 2010
I'm writing an android application which listens the phone calling events. What I want to do is, if there is a call incomes or outgoes, an activity shows with my customized info.I want to this screen keeps showing during the calling period. However, if a call is coming, the system UI which shows the contact always appears on top of my activity.I've found some apps already realized this function, but mine can't.
View 1 Replies
View Related
Jul 17, 2009
There is an activity which fetches xml data from the network, parses it and displays it in the UI. When the user clicks on any of the link or button on the screen I call startActivity with new Intent object of the same activity. I do this to have the activity on the history stack. Previously I just called setContentView of the activity without starting the activity again, but with this I cannot have the previous page in the history stack.Now the problem is - each screen normally takes up to 20 seconds to fetch content, parse and display. when the startActivity is called the screen becomes black until the next UI is rendered. I wanted to keep the previous screen showing until the next page loads.Please tell me 1. Is there a way to do this? 2. Is it good to start the activity again for each page. If not how to have the previous page in the history stack so that I can use the Android's back button.
View 6 Replies
View Related
Jul 14, 2009
I have a map activity for which I would like to have the screen turned on as long it's active (the app consists of one activity only). When the activity is paused or stopped I want to return to normal on/off mode. Keeping the screen on works fine while the app is running but when I exit the app the screen stays on as well. What am I missing?
View 3 Replies
View Related
Mar 24, 2010
I'm developing an Activity with a simple LinearLayout with a button. When I try the activity on my hardware (WVGA 480x800 screen) the activity only fills the standard size (480x320) while the OS itself fills the whole screen.
What could be the issue.
CODE:..................
View 1 Replies
View Related
Dec 14, 2009
Any idea why this doesn't create an activity that looks like a popup instead of an activity that completely fills the screen?
CODE:.............
I assumed that I only needed to set the layout height and layout width to something other than "fill_parent", but it still shows up as a black screen that completely fills the screen.
Ultimately, I simply want to create a popup, but I do not want to use an AlertDialog. Is this possible?
View 2 Replies
View Related
Jul 14, 2010
How can i made an activity with a window "not full screen" ?
Goal is to have a windows like this one : http://developer.android.com/guide/topics/ui/notifiers/toasts.html ("Creating a Custom Toast View" section), but i don't want to make a toast, because toast's life time is too short for what i want to do.
View 2 Replies
View Related
Jun 19, 2009
I created some custom elements and I want to programatically place them to the upper right corner (n pixels from the top edge and m pixels from the right edge) therefore I need to get the screen width and screen height and then set position:
int px = screenWidth - m;
int py = screenWidth - n;
Does anyone know how to get screenWidth and screenHeight in the main Activity?
View 3 Replies
View Related
Nov 2, 2009
I've looked through the documentation and I can't seem to figure out how to have the screen blured/greyed when I select an activity that may take a while to load.
This seems to be an Android standard (both the Camera app and the Camcorder app do it when first selected), but I don't see any documentation on it. I even tried looking through the source of these apps on git, but couldn't seem to find it.
View 3 Replies
View Related
Jun 12, 2010
How can we pass Android Home Screen Widget info ( putExtra maybe ) to an Activity.. What particular method callback will handle this one?
View 1 Replies
View Related