Android :: Set Solid Background To Spawned Activity

Sep 9, 2010

I'm not very familiar with the android SDK yet. I have an application (game), which is developed mainly using the NDK, and uses egl to render. i have an activity which handles the egl swapbuffer and runs the games native main loop, pretty straight forward I guess.

Now I have made another activity which host a TableLayout containing an EditText as well as a button (simply for text-input later used by the game). I spawn this activity from my main activity using startActivityForResult. The small problem I'm having now is that I can't manage to make this "popup" activity to have a background, so my paused game will reside in the background, with the various widgets just overlaid. This is not very pretty in my opinion, and I would like to at least have a solid background color for my spawned activity while it's active. I *could* just simply go into some state in the games main loop which clears the gl-screen just before I spawn the new activity. But I don't like this solution and it's a tad more work then I'm prepared to put in just at this time in the project. I'm pretty sure there is some simple way to just set a background color somehow, I just can't find *any* way to do it, I've looked around in the SDK resources and tried to search for any hints towards this, but i'm just not familiar enough with the java SDK to find what i'm looking for.

On a side note I would also like to be able to center the EditText widget as well as the button on the screen once the Activity is active, I haven't looked very deeply into it yet, but from a quick glance of the documentation I couldn't really find any suitable positioning methods in the tablelayout class. But as I said, haven't looked very hard. Can probably solve that one easy, but i'm just throwing this in as well :)

Android :: set solid background to spawned activity


Android :: Access Original Activity's Views From Spawned Background Service?

Jul 21, 2009

I have an activity called A, and on the selection of menu item 0, it spawns service B, which starts a runnable C in a new thread. I have a TextView in activity A, which I want to access in thread C.

I've tried making the TextView a public static field, but that generates the following error:...........................

View 5 Replies View Related

HTC Desire :: How To Change Background Into Solid Color

May 16, 2010

Is it possible to change Wallpaper Background Image into SOLID COLOR only? I want change into totally black.

View 11 Replies View Related

Android :: Resume Activity And Play Audio File After Spawned Thread Completes Download?

Jan 13, 2010

I've got an activity that calls a helper class called DownloadManager. DownloadManager spawns a thread that downloads a mp3 to the sdcard. I'm having some trouble finding the best design for resuming the initial activity and starting the MediaPlayer. Does it make the most sense to use a BroadcastReceiver that receives a message that download is complete, then start a new Intent of my activity? Think I saw something that I can't use an Intent to start an Activity from BroadcastReceiver because it is a background process.

View 4 Replies View Related

HTC Desire :: Change Wallpaper Background Image Into SOLID COLOR

May 16, 2010

Is it possible to change Wallpaper Background Image into SOLID COLOR only? I want change into totally black.

View 3 Replies View Related

HTC EVO 4G :: Default Solid Color Wallpaper For Phone / Should I Setup It JPG As Background?

Jul 13, 2010

Is there a default solid background for my Evo wallpaper? All I have been able to find are pictures, or Live wallpapers; not colors.

Or should I set a solid color JPG as the background?

View 1 Replies View Related

Android :: Start Activity When Main Activity Is Running In Background

Jan 10, 2010

I created an application which enables the user to set whether he wants to receive notification while the application runs in background mode. If the notifications are enabled an activity should be started (the dialog should appear on the screen).

I tried to enabled it the following way:

CODE:...........

This is the method from main activity. When onPause() is executed isRunningInBackground is set true.
When I tried to debug it when the main application was running in the background the line

startActivity(intent) had no effect (the activity didn't appear).

Does anyone know how to midify the logic in order to start an activity from the main activity when the main activity is running in the background (after onPause() is called)?

View 1 Replies View Related

Android :: Keeping Notification At The Status Bar After Service That Spawned Stops

Mar 9, 2010

I have a main application, that at some point spawns a service that checks for updates, if it finds any, it posts a notification with the ink to the update, and then the update service stops. Through the debugger I've noticed that the notification pops up but then disappears once my service is stopped, which I guess makes sense since the Notification object was instantiated within that service. What would be the best practice of keeping that notice available until the user clicks it?

1) somehow attaching the notification to my top service - which might get really ugly --> since that update service is spawned by another sub-service that is spawned by a broadcast receiver... so even if i wanted to somehow pass the object of my top level service it would mess the entire abstraction of my app structure and would force me to keep pointers to it through every event and service that I use... Perhaps there is some other way to get that service through the app's context? or any other alternative?

2) Finding a way to keep my update-service alive until the user presses the notification, but I'm not sure if there is any intent broadcasted that I could listen to...

View 2 Replies View Related

Android :: How To Persist Options Selected In AlertDialog Spawned From ItemizedOverlay OnTap Method

Jun 7, 2010

In the description of how to add a list of options to an AlertDialog the official Android documentation alludes to saving a users preferences with one of the "data storage techniques." The examples assume the AlertDialog has been spawned within an Activity class.

In my case I've created a class that extends ItemizedOverlay. This class overrides the onTap method and uses an AlertDialog to prompt the user to make a multi-choice selection. I would like to capture and persist the selections for each OverlayItem they tap on.

The below code is the onTap method I've written. It functions as written but doesn't yet do what I'd hope. I'd like to capture and persist each selection made by the user to be used later. How do I do that? Is using an AlertDialog in this manner a good idea? Are there better options?

CODE:.......................

View 2 Replies View Related

Android :: Activity In Background ?

Nov 19, 2010

Is there a way to 'preload' a user interfaces but to not display it until I am ready?

I have a service which has a receiver to listen for action_screen_on to occur. When that occurs, I would like to load an activity. However, as it is now, it takes about 1 second to load. I would like to preload the layout in advance so that when the screen is turned on the layout loads as soon as possible.

View 2 Replies View Related

Android :: Want To Change Background Of Activity

Jun 23, 2010

How to change background of activity and background of the application name at the top of your activity?

View 2 Replies View Related

Android :: Activity Background Becoming Black

Nov 19, 2010

i have set the background of an activity with a green gradient png image.This working fine almost always but some times during navigating to an activity its background is becoming black! i am not able to reproduce it with any specific operation, also not getting how to debug or fix it.

View 3 Replies View Related

Android :: Activity Background Processing

Apr 17, 2010

"Note that when you write an activity, you can make it stop or continue running when it is moved to the background (see onStop() in Activity Lifecycle). For activities that download data from the network, it's recommended to let them continue downloading so the user can multi-task." As far as I was aware I had to create a service if I wanted to have a background activity such as a media player, internet download, or processing of data in files on the SD card continue when the activity was no longer in the foreground.I went and reread the onStop information on the "Activity Lifecycle" page, which was referred to. But I didn't find any mention of how an activity might continue to run in the background after onStop was called.

View 3 Replies View Related

Android :: How To Detect An Activity Goes Into Background

Aug 5, 2010

I need a way for my Activity to known that it's going into the background, and not when it's getting killed. I thought about hooking at onStop(), but onStop() is called for both cases. In other words, is there a way to tell if when my Activity is moving into the background and not getting killed?

View 2 Replies View Related

Android :: Background Tasks And Activity

Jul 14, 2010

Has anyone any idea on how to solve the generic problems related to starting a task in background from an activity and when the task is finished posting the result to the activity that created ? (the activity might get destroyed in the meantime due to a orientation change ,or receiving a call , or might be in the process of destroying and recreation)

View 2 Replies View Related

Android :: Start An Activity In The Background?

Aug 4, 2010

Is it possible to start an Activity in the background? I need such an Activity that can operate in the background and spawn other Activities as needed in response to user commands issued to my Home Screen widget.

View 1 Replies View Related

Android : Add Background Image To Activity?

Jul 22, 2010

Using theme or ImageView ?

View 2 Replies View Related

Android :: Changing Background Color Of An Activity

Jan 31, 2010

When i launch Activity A, the screen goes black, then dark-gray. Then A launches B, and the screen goes black and dark-gray again. Is there a way to set the default background color to black? Activity A has no screen, its just a stub that calls B.

View 4 Replies View Related

Android :: Activity Should Be Transparent / But Has Black Background

Apr 22, 2010

My use case is writing an overlay controller activity for a landscape camera preview. I followed the instructions from a couple of tutorials for writing a transparent theme.When I start this activity from my root activity, the layout gets drawn correctly, but the background stays black. I tried to use @android:style/Theme.Translucent instead, but this Theme inherits the orientation from the calling activity (landscape) and thats not what I want.The application holding the camera preview is set to landscape view as it does not display the preview correctly in portrait orientation. (see old google bug report)What I wanted to do was to put an independent activity for user interaction interface in front of the camera surface holder (this activity should be set to 'portrait', or even better to 'sensor')

View 3 Replies View Related

Android :: Make Activity To Background With Out Finishing?

Jan 11, 2010

How can i make an activity go to background without calling its finish() method and return to the Parent activity that started this .I tried so much but it really dint help.So if you guys could help i would be very thankful.

View 2 Replies View Related

Android :: Child Activity Lifetime In Background

Sep 15, 2010

I have next problem, I have got parent activity and few sub- activities, if app goes to the background by pressed HOME button for long time, all children will be killed, and my app restart from parent activity.

For example: A1 - parent, A2,A3,A4 - sub-activities. A1-->A2-- >A3(top), from A3 I go to the background (HOME). wait 30-40 min and

View 7 Replies View Related

Android :: Get Background Color Of Activity In Java?

Sep 7, 2010

How can I get background color and text color (default for child views) of an Activity in Java?

View 1 Replies View Related

Android :: Activity Image Background Size?

Sep 12, 2010

I am a bit confused on creating an image which will be acting as a background for my activities. So, in short, my aim is that my application should be able to fit the different screen sizes. Therefore, what size in pixel should my three images be to be able to fill the screen of the device in ldpi, mdpi and hdpi?

View 2 Replies View Related

Android : How To Add A Background Image To Droid Activity

Oct 12, 2010

My goal is to develop a GUI application on top of a background image with buttons in specific places on the image. The first step is to display the background.

The image can be displayed with resources and is described in several FAQs including this one:

how-to-add-background-image-to-activity

It compiles and runs without errors, but the background is black. Here is the main.xml file:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout android:id="@+id/rootRL" xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/background">
</RelativeLayout>

The image has been in png, 9.png, and jpg format with basenames of 'main' and 'background'. It builds but does not display. Making clean and recompiling does not help.

This behavior occurs on both the emulator and on hardware -- an Atmel AT91SAM9M10-G45-EK. The SDK version is 2.0.1.

View 1 Replies View Related

Android :: Start Activity From Service - Running In Background

Nov 13, 2009

I want to develop a application that continuously running in background as service. And after that if i press any numeric key, it should start an application.

I have developed a service which is running continuously. Is it possible in Android?

View 2 Replies View Related

Android :: Bring Activity To Front From Background Service?

Mar 17, 2010

I am aware my issue is against the philosophy of Android, but I have no choice, this application will run on a embedded car gps and I need to bring an activity to prevent from car accident, for example, when it's happen around the user. I have to put other activity on the back and bring my alert pop up without user manipulation like notification on the front. Is there a way to bring manually an activity to the front, by resuming it like when you click on the android task switcher?

View 2 Replies View Related

Android :: Update Information In Activity From Background Service?

Mar 18, 2010

I am trying to create a simple Android application that has a ActivityList of information, when the application starts, I plan to start a Service that will be constantly calculating the data (it will be changing) and I want the ActivityList to be in sync with the data that the service is calculating for the life of the app. How can I set up my Activity to be listening to the Service? Is this the best way to approach this problem? For example, if you imagine a list of stock prices - the data would be being changed regularly and need to be in sync with the (in my case) Service that is calculating/fetching the data constantly.

View 3 Replies View Related

Android :: Background Activity For Map Started Again When Orientation Change

Apr 6, 2010

i've developed an android app that's fetches an xml file and displays this data via several markers on the map. This works fine so far. The problem right now is that when i switch the orientation of the phone (portrait->landscape or vice versa) the markers disappear for a small moment, the xml processing is started again and then they reappear. Is there a way to prevent this re-loading of the file? It only takes about 2-3 seconds.

View 2 Replies View Related

Android :: SurfaceView - Does Not Show The Activity In Grey Background

Jul 27, 2009

1)Which is better for developing a game.

a)Using XML layouts

b)Using Custom layouts with Surface view

2) while making a custom view using Surface view... do we need to have a secondary thread to implement the surfaceholder.callback()......

My code below does not show the activity in grey background as i have coded... do i need to use the unlockcanvas and all ,,but i havent used the secondary thread

CODE:..............

View 2 Replies View Related

Android :: Bring Activity In Background To Front Via Notification

Aug 5, 2010

I create an application which displays the notification when the service starts. If an user navigates to HOME screen (without exiting the application), the user could still go back to the previous application by pressing on the notification icon. This is very similar case as the track recording service in Google application "My Track".

I want the existing activity as Single Top activity since it has associated service running. However when my application tries to bring the existing activity to front via notification, the existing activity's onDestroy has been called which causes problem. How can I skip this onDestroy method? Here is my current codes:

CODE:............................

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved