Android :: How To Start Stop Activity?

Sep 21, 2010

1. press home key to stop my AP (activity change to stop , not destroy )

2. use "CountDownTimer" for sleep 3 secs , when timer finish use sendBroadcast() to call my BroadcastReceiver

3. finally , BroadcastReceiver use intent to start my AP (activity change to start).

Android :: how to start stop activity?


Android :: Start And Stop Music On Application Launch And Stop

Jan 5, 2010

In my application i have several activities and i want to start background music whenever my *Application* is launched and stop music whenever *Application* is paused or stopped.

View 4 Replies View Related

Android :: Start An Activity And Return Back To Original Activity

Jan 26, 2009

I have an application with contains multiple activities. The main activity will start the others ( use startActivity() ) depends on user event, when an activity close, it calls finish() and return back to main activity. It appears to behavior like that.

However, the "problem" I see is main activity's onCreate function is called every time. I think the the main activity should be placed in the activity stack and simply push to front when others exit, therefore only onResume, onStart are called. Is there some flag I need to set or I misunderstand the activity behaviro?

In child activity, besides calling finish() or startActivity for main activity, what is other way to move main activity to front?

View 2 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 :: Start An Activity In Different Apk Using StartActivity - Using The Activity Name Or Similar

Apr 20, 2010

I have tried to write an Android application with an activity that should be launched from a different application. It is not a content provider, just an app with a gui that should not be listed among the installed applications. I have tried the code examples here and it seems to be quite easy to launch existing providers and so on, but I fail to figure out how to just write a "hidden" app and launch it from a different one.

The basic use case is:

App A is a normal apk launchable from the application list.

App B is a different apk with known package and activity names, but is is not visible or launchable from the application list.

App A launches app B using the package and class names (or perhaps a URI constructed from these?).

I fail in the third step. Is it possible to do this?

View 3 Replies View Related

Android :: Activity Check Service To Start Another Activity

Sep 10, 2010

I need to made an activity (without layout) that on start check if a service is running. if it is true it starts Activity2, if it false it starts Activity1.

I tried with this code:

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

Enter code here

But when I check, in the onCreate method, if serviceConnect!=null I receive sometime a NullPointerExcption.

I tried also to insert the operation in the method onCreate in an Async Task:

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

View 2 Replies View Related

Android :: Start Activity And Clear Activity History

Apr 22, 2010

I have a huge maze of activities in my application. What I need to do, is that when the user logs in into the system, the activity history should be cleared. I cant just use finish() when I start a new activity, because I want the activities to have a history until the user logs in. I have experimentet with the different flags when starting an activity, but I have had no success.

View 1 Replies View Related

Android :: Start A New Activity From Anther Activity

Nov 19, 2010

I want to start a new activity from ab activity that (extends from Linearlayout) .. but this code is not right

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

public class SearchResultForm extends LinearLayout{ ...

And i get this error ..

No enclosing instance of the type SearchResultForm is accessible in scope.

View 4 Replies View Related

Android :: Start An Activity From Non Activity Class

Aug 19, 2009

An activity can be called from existing activity through *startActivity(intent); *

Is t possible to call an activity from non Activity class ? and how?

View 2 Replies View Related

Android : How To Start An App After A Force Stop?

Oct 22, 2010

If I Force Stop an app (via Settings->Applications->Manage Applications->Any App->Force Stop) will the app ever start up automatically again or is the only way to start it up again to have the user start it. I have an app that starts a service. The service registers an alarm I've defined, with the Alarm Manager and this is recieved as expected. In my manifest I've defined a TimerIntentReceiver, to receive that alarm I've defined. If I Force Stop the app then is it possible to have the Alarm Manager "wake" my app up via the TimerIntentReceiver I've defined. I'm not seeing this happen. Once I Force Stop my app it never runs again unless I manually start it. Is there anything I can listen for, apart from BOOT_COMPLETE, to start up my app? Or does the user always have to start all apps.

View 2 Replies View Related

Android :: MediaPlayer - Raw Resources - Stop And Start

Jun 3, 2010

I'm playing around with the MediaPlayer class to reproduce some sounds/music. I am playing raw resources (res/raw) and it looks kind of easy.

To play a raw resource, the MediaPlayer has to be initialized like this:

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

Until here there is no problem. The sound is played, and everything works fine. My problem appears when I want to add more options to my application. Specifically when I add the "Stop" button/option.

Basically, what I want to do is...when I press "Stop", the music stops. And when I press "Start", the song/sound starts over. (pretty basic!)

To stop the media player, you only have to call stop(). But to play the sound again, the media player has to be reseted and prepared.

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

The problem is that the method setDataSource() only accepts as params a file path, Content Provider URI, streaming media URL path, or File Descriptor.

So, since this method doesn't accept a resource identifier, I don't know how to set the data source in order to call prepare(). In addition, I don't understand why you can't use a Resouce identifier to set the data source, but you can use a resource identifier when initializing the MediaPlayer.

I guess that I'm missing something. I wonder if I am mixing concepts, and the method stop() doesn't have to be called in the "Stop" button.

View 4 Replies View Related

Android :: Start A Map Activity From Other Activity

Apr 8, 2010

I am developing an aplication. This one is designed to login a user, then select how find a place, using simple data or using a map. When I try to set in the event OnClick for select the "Map way" (using intent):

startActivity(new Intent(getApplicationContext(), MapviewController.class));

I have problems and didn't work.

My class and manifest are:

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

Do you know any way to call the MapActivity from other?

View 3 Replies View Related

Android :: How Do I Start And Stop GPS Through Program To Save Power?

Mar 5, 2010

I want to use GPS service for better accuracy in my program, but want the location only once in every couple of hours. To get GPS location the GPS had to be started already manually through Settings->Location Security->Use GPS Satellites. But the problem is GPS continuously running whether I need the location or not and drains the battery quickly. My question is what is the equivalent API for the checkbox selection of,

View 2 Replies View Related

Android :: Running Service On Start Up And Stop Before Shut Down

Jan 30, 2010

Is there an API, or a registry I can do in the manifest to make sure my service is being run at the device start up and being shut down before the device shuts off?

View 3 Replies View Related

Android :: Start / Stop Built-in Wi-Fi / USB Tethering From Code

Aug 8, 2010

How can I start or stop the built-in tethering in Android 2.2 from my application?

View 1 Replies View Related

Android :: Start And Stop BOOT_COMPLETED In Broadcast Receiver

Jun 22, 2009

Could we, and how start and stop a broadcast receiver receving the android. intent. action. BOOT_COMPLETED?As I want have control on a service awaken by the BOOT_COMPLETED.

View 2 Replies View Related

Android :: Resume Download After App Stop/start Lifecycle

Feb 6, 2010

I've an App which performs a potentially large download in background thread. When the orientation changes or the keyboard is opened the App lifecycle system invokes the start/stop/pause/resume etc calls - is there any strategy available to resume the download rather than just set a flag so the new onCreate() knows it was interrupted and has to start it again?

View 2 Replies View Related

Android : System Lock Up - Restarts When I Start And Stop My App

Jul 16, 2010

I have this game, which is almost done. It has 1 critical bug. When the app exits and restarts, the phone goes in to super slow mode and eventually restarts. I am at a loss as to how to debug it.

It seems like something is happening to make the program run super slowly. The ND time the program exits it takes a very long time to exit and when the phone returns to the main screen the program is almost totally unresponsive. The phone will eventually restart itself.

View 8 Replies View Related

Android App To Login To Website - Start And Stop Action

Feb 7, 2014

I am absolutely new to android and web development. I would like to make an app which I can use to login to my account on a website (URL,,,) and to be able to start and stop the parking time. It should also show the time passed and notify every 30 minutes about it.

I am not looking for code (but of course, it would be nice to have some examples) at this moment but for some tutorial or a list of functions which I need to program to make such an app. If there is an existing application which I can modify for my needs, I can also try it.

I tried to search but the most of the content assumed for people with some knowledge of http post (I even do not know what it is) and others.

View 4 Replies View Related

HTC Incredible :: Stop Apps On Start Up

May 2, 2010

There seems to be a lot of useless stuff opening on startup, not all "apps" necessarily... is there a way to stop this stuff from starting? I love the phone but it blows my mind that there are so many apps that you can't even quit without dl'ing a task killer.

View 5 Replies View Related

How To Stop Scrolling Bar When Start Search Using Edittext

Nov 16, 2012

how can i stop the index-alpahbtical section or the scrolling-bar when i start search using edittext. i used Intent to pass the value of edittext to the scrolling class and check if not empty scrolling.hide() ,but i got error massge and can't work,

View 3 Replies View Related

General :: How To Stop And Start Tasker By Itself Via Bashscript

Sep 16, 2013

I want to stop and start tasker by itself via a bashscript since I see no other way to do so. This works if you put in terminal line by line:

Code:

am force-stop net.dinglisch.android.taskerm
am start -a android.intent.action.MAIN -n net.dinglisch.android.taskerm/net.dinglisch.android.taskerm.Tasker
killall net.dinglisch.android.taskerm

But now I'm stock

My guess was that it would have to work if i put in a file "kst.sh" and run

Code:

sh ./kst.sh
as root.

But it doesn't work and it seems to ignore the linebreaks in the file.

So here I am, knowing the commands and need to run them with one call. How do I do that?

View 1 Replies View Related

Android :: Start New Activity In TAB

Jan 5, 2010

I am working on a travelling application and i am using tabs and each tab has an activity i.e world clock in one tab ,weather data in another tab and so on with in the weather tab i am displaying the users selected cities and the scenario is that when the user selects a city that city's forecast is to be displayed and later to view details as well which is in another activity . how can i launch this new activity from the already started activity with in the same tab ?

View 4 Replies View Related

Android :: Why Won't Activity Start

Sep 13, 2010

I'm trying to start an Activity with startActivityForResult, but I keep getting an ActivityNotFound exception, and I can't work out why. I've looked through the code multiple times, and it seems to be identical to some other, working code. Any suggestions?

The newNoteButton that starts the Activity:

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

And the beginning of the TypyEdit Activity:

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

View 1 Replies View Related

Android :: How To Start An Activity

Sep 15, 2010

I have created two classes: Example1 and Example2, which extends activity.

Example1 contains a UI of buttons, while Example2 contains UI of TextEdit.

I want to call Example2 when a button is clicked, so this code is in an onclick method

Intent i = new Intent();
i.setClassName("com.a.ui", "com.a.ui.Example2");
startActivity(i);

So I am able to get the UI of Example2 successfully.

What's an alternate way of calling intent?

Is there any alternate way to start an activity?

View 2 Replies View Related

Android :: Can Start New Activity That's Not Specified

Jun 25, 2010

I'm trying to do some dynamic code and I load a new class that's supposed to be an Activity and I want to start it, but using the regular startActivity(Intent) wants the Activity to be "Declared" in the AndroidManifest.xml file.

View 1 Replies View Related

Android :: Google Maps Broadcast Event For Audible Navigation Instructions / Start And Stop?

Dec 14, 2009

I have an application which is playing audio.I have some customers that use this application while driving and who also use the Google Maps application to get directions to the places where they are driving.They have asked me to change my application to pause my audio while the Google Maps application is giving them audio navigation instructions. I am trying to find out if I can register a Broadcast Receiver to let me know when the Google Maps application is giving audio navigation instructions, or if there is a way to detect when any other application has started or stopped playing audio.It seems that this type of functionality would be beneficial for Google Maps and for any type of application which is playing media, so I am hoping that Google Maps is broadcasting events when it starts and stops giving audio navigation instructions, or that there is a generic way to discover when overlapping audio sources are trying to play.

View 6 Replies View Related

Motorola Droid X :: How To Stop Running Services That Start Up?

Jul 16, 2010

I was wondering if I can somehow permanently get rid of some running services that start up on my phone? I'm speaking specifically to the motorola widget ones such as social networking and news that are running even when i haven't signed up for them.

View 7 Replies View Related

Android :: PopupWindow On Activity Start

Feb 21, 2010

I am trying to make a PopupWindow show straight away when an activity has started.

when calling public void showAtLocation (View parent, int gravity, int x, int y)

I get the exception ERROR/AndroidRuntime(2500): Caused by: android.view.WindowManager $BadTokenException: Unable to add window -- token null is not valid; is your activity running?

At the moment I am calling from onCreate, but when calling from onStart or onResume it still gives the same error.

The activity api says the activity is supposed to be running after onResume is called. Where is the best place to load up the PopupWindow if it needs to be done straight away?

At the moment It looks like Activity.onWindowFocusChanged() is the best place.

View 2 Replies View Related

Android :: Start Activity Without Manifest

Jan 22, 2009

I create my Network provider and I want to start Activity from it. Is it necessary to create separate Activity with Manifest and then launch it using startActivity? Can I launch unregistered Activity directly from my provider?

View 5 Replies View Related







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