activity

how to start activity when the main activity is running in background?

Hi, 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: @Override public void onProductsResponse(Li...

Sharing domain objects between activities

I have written my application logic in domain objects (to enable multiple user interfaces and porting to other platforms), and am now lookng at implementing Activities for the user interface. Considering that each activity needs to serialise its state, what is the best way to ensure my domain objects are only serialised once? ...

Sending Activity to background with out finishing

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. Thanx n Regards, HaKr ...

android close application

I've two different activities. The first launches the second one. In the second activity I call System.exit(0) in order to force the application to close but the first activity is automatically displayed instead of come back to the home screen. How can I avoid this feature ? ...

Android: How to restart an activity within a tabhost?

I've searched and I know it seems some people frown upon using activities within tabs, but moving past that...how would I restart a tabbed activity while still keeping the tabs visible? I have an activity in a tab, I use the menu to create a new activity to update the tab's activity displayed info, when I return from the menu activity I ...

Android: Wakelock & handling orientation change

I'm using Wakelock in my application to prevent the phone from sleeping when the app is visible. The problem comes when there is an orientation change and the system destroys and re-creates the app in landscape mode. If the wakelock timer has expired in the background the system takes the release of wakelock as an opportunity to switch ...

Problem with list activity

I have implmented pagination and it display 5 records per page. Now suppose I am on page 3 and click 3'rd element then 3'rd element of page-1 is selected. I am not able to figure out problem as I always create new list object while setting data. I used below code temp = new ArrayList(); this.someListAdapter = new SomeListAdapter(this,...

From WebView Errors to ImageView Cover-ups to Screen Orientation

It all started with a simple WebView within an Android app. This view loads info from a public URL. Nothing unusual there. However ... if there should be a network interruption, you can easily end up with an error displayed prominently in the WebView. Well, that's no good, right? So I searched the docs and elsewhere for a way to suppr...

Launch Activity from Preference Activity causes Permission Denial Exception

Hi, I'm having a bit of a problem here. What I want to do is launch an Activity from within the PreferenceActivity. So my preference.xml which holds the preference layout looks like this: <Preference android:title="Launch Activity" > <intent android:action="org.momo.SOME_ACTIVITY" /> </Preference> The manifest is aware of the activ...

how to Open new screen in Android?

Dear friends, i am new to android and i have created a login page after verifing login i get results true or false on the bases of user authentication now my goal is to show another screen on successful authentication with some new textboxes and button i mean new layout how to achieve this??? any help would be appriciated. ...

how can you tell when an Android activity is finished loading?

I'm in the process of working on an automated test suite for our android app, and running into trouble waiting for activities to fully load. I can call getActivity, but just because it shows the activity that I'm hoping to see in my test doesn't always seem to mean that the activity's components are ready for use (fully loaded). Lookin...

How do I parameterize an Activity from within AndroidManifest.xml

I have a CustomListActivity which I wish to expose two facets of the same data. For example: I have a list of cars, and would like to list the set of colors, and the set of models. These would be filtered on mimetype from my ContentProvider: org.acme.cars.cursor.dir/colors org.acme.cars.cursor.dir/models My CustomListActivity is qui...

How to enforce activity if app is running?

I start an Activity from my Widget, which should start a special view. But if the app is already running (not left with back button), Android instead activates the activity that was last shown. Is there any flag or other way to avoid this behaviour? Closing the previous activity wouldn't be a problem in my app, there's no user input that...

Replace current activity

I need to replace the current activity with a new one. That is, I want to start a new activity and remove the current activity from the task stack. Based on the documentation, it seems the best way would be to start the activity using Activity.startActivity as per usual, and then call Activity.finish immediately to close the current act...

How to clear stack back to root activity when user leaves application?

I have an application with 2 activities, LogonAct and MainAct. LogonAct is a logon activity which I want to force the user to go through each time they return to the application. I've set android:clearTaskOnLaunch="true" on LogonAct. When I first start the app I go through this sequence of screens, Home -> LogonAct -> MainAct -> Home ...

problem in passing data in android Activities?

dear friends, can any one guide me what mistake am i doing in this code??? it not seems to be working.. i have two activies public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Intent intent = new Intent(DataPassing.this, DataPassing2.class); Bun...

Do root views of an Activity in Android have any prior knowledge of the child views that will be loaded into them?

Is there any way to query a root view of an activity for all of its child views even before the root view or its children have been inflated? I guess what I'm looking for is whether a view knows ahead of time what children it will have before it gets inflated, and can I get that list in some way. Bizarre I realize, but I think it will ...

How to send an object from one Android Activity to another with Intent.putExtra?

Dear friends, Can anyone guide me as to how I can pass an object of a custom type from one Activity to another with the putExtra() method of Intent??? Any help would be appreciated. ...

Android - Sending data from a class to an activity?

Hi all, Have a question about sending data between classes and activities. I currently have a class that monitors outgoing class and gets the number of an outgoing call. I instantiate this class in my main Activity and run its method that retrieves the number. However I now have another Activity that I want to pass the number to. I...

How to implement master and child page like Activity in Android?

Dear friends, I want to place a common banner and menu on each Activity with footer too. Can anyone guide me how can I implement master and child page like asp.net in Android??? Any help would be appreciated. ...