Android :: Activity Events On StartActivity

Sep 28, 2010

Is there any event triggered on an activity when I call startActivity("activity_id", myIntent);

If the Activity exists already. I pass a parameter to the activity via i.putExtra("someID", someSerializableObject ); and would like to call a method to refresh a WebView. Right now, the call on startActivity brings the activity in the foreground but the webview does not display what i want.

Android :: Activity events on startActivity


Android :: Exclude Own Activity From Activity.startActivity - Intent

Oct 17, 2010

My app works with pictures. It can take multiple pictures as an input, process them, and send them again to another app.

As a consequence, my main Activity has declared an intent filter on ACTION_SEND_MULTIPLE for image/* mimetypes and can result in issuing a new Intent with the same action and data type using Activity.startActivity(Intent).

Is there a way to exclude my own activity from the list of apps that is displayed to the user after the startActivity() call ?

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 :: Calling StartActivity From Outside Of An Activity

Dec 7, 2009

I have a TabActivity subclass that attempts to start a new activity via a menu item selection in onOptionsItemSelected.I am receiving the following exception which eludes me at the moment.I'm not sure why it thinks I am *not* in an activity!

View 2 Replies View Related

Android :: Calling StartActivity From Outside Of An Activity - Getting Error

Sep 11, 2010

I'm using an AlarmManager to trigger an intent that broadcasts a signal. The following is my code:

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

I'm calling this code from an activity, so I don't know how I could be getting the following error...

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

Is this really what you want?

View 1 Replies View Related

Android :: Calling StartActivity From Outside Of An Activity Context

Oct 12, 2010

I have implemented a ListView in my Android application.

I bind to this ListView using a custom subclass of the ArrayAdapter class. Inside the overridden ArrayAdapter.getView(...) method, I assign an OnClickListener. In the onClick(View v) method of the OnClickListener, I want to launch a new activity.

I get the exception:

Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?

How can I get the context that the ListView (the current Activity) is working under?

View 2 Replies View Related

Android :: StartActivity -ForResult - At The Creation Of Main Activity

Mar 31, 2010

I would like to display a an access dialog activity at the start of my application.

In other words, I would like to start another activity (in dialog theme) as soon as my Main Activity is loaded. But, I know that I can not start an activity while another is creating.

I tried to start this activity in the onResume() method : I can see the new activity called, but the Main activity do not respond after closing the new activity.

Is there a solution to do this, without using delayed intent ? May i use a special flag for my intent ? I did not find, in the activity cycle, a way to detect the end of activity loading.

View 6 Replies View Related

Android :: StartActivity -intent - And Resume To Main Activity

Jul 2, 2010

I've got an app that creates an intent for the last.fm android app in which it will start the "recommended" station for my account when i press a button. The trick i'm trying to figure out is how do i get the phone back to my app without the user having to navigate back manually? Once it start the last.fm intent it takes you to the playlist and i need it to resume back to my app automatically.

View 2 Replies View Related

Android :: Pass Intent Via StartActivity() To A Running Activity

Aug 10, 2010

MyService and MyClient are both running, although MyClient is currently in the background. If MyService sends an Intent to MyClient via:

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

How do I get this Intent in MyClient? Running this code triggers onResume() in MyClient, but because it's already running, calling getIntent() returns the Intent that initially created MyClient, which is always android.intent.action.MAIN

View 2 Replies View Related

Android :: Update Intent Of An Existing Activity While Calling StartActivity

Sep 13, 2010

I am having two activities, say activity A and B. Activity A is an ListActivity, and when the items in the list is selected, it will call startActivity() to bring up B. The problem here is that when I am in B and click the home key, and then go to the application launcher to resume my application, A will be brought up again. This time when I click a different item in A, it will bring up B with the old data of the previously selected item before the home key was clicked.

After examinzing the code, I found that the startActivity does not update the intent of B. I found a post here about the similar question, and the answer was to overwrite the onNewIntent. However, I found that it doesn't work, because this method never get called when the second time I call startActivity. I am sure that this is the same instance, because I've printed out the instance number. Is there any other ways to update the intent of the activity? Or I need some other settings to make the onNewIntent get called? I didn't set any flags or launch modes, so everything is default.

View 1 Replies View Related

Android :: Calling StartActivity From Outside Of An Activity Context Requires The Flag_activity_new_task Flag

Sep 21, 2010

I tried to create a edittextbox, and button next to it, in the status bar.! I created it and tried to launch the browser activity, when somebody enters a URL in the textbox & click that button.

I get runtime exception as below.Can anyone please help what is the issue with this exception ? I know that Status bar is not a seperate activity. It is part of 'PhoneWindow'.

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

View 7 Replies View Related

Android :: How To Capture Key Events With Window-less Activity?

Dec 2, 2009

I have an Activity which has no window (but it has a view). I'm using: getWindowManager().addView(view, params);I've attempted to call takeKeyEvents(true), however I see that takeKeyEvents first retrieves the Window and then calls takeKeyEvents on that Window.In my case, the Window is null.What this means is that I never receive onKeyUp and onKeyDown calls, which I need in order to intercept some key presses from external input devices (similar to a handsfree set for example).

View 10 Replies View Related

Android : Way To Handl Key Events In A Paused Activity?

May 4, 2009

A main task and a secondary task - the secondary task has only one Activity - when that Activity is paused (e.g. Home key pressed), a notification is inserted to the Notification Bar, so that the user can go back to it (such as voice call does) My problem is: I need the paused Activity to receive key events. 1) Is that possible? 2) If so, how? (I have already tried setting "takeKeyEvents(true)", but whenever I press a key, the "Bookmarks" activity comes to the foreground)..

View 17 Replies View Related

Android : Send Touch Events To Foreground Activity

Jul 21, 2010

I'm trying to figure out a way to send touch events to the foreground activity. Essentially I want to write something that allows me to run it from the shell and just say "I touched this co-ordinate", so that I can automate some UI tasks for testing. Essentially what Monkey does, but application agnostic.

I think that android.view.MotionEvent holds the key, but I'm not sure how to run something without view so that I don't interfere with what is on the screen. Perhaps with a service, but I'm unclear how that would work.

View 5 Replies View Related

Android :: Implement Touch Events On Activity And Button On Droid?

Apr 23, 2010

I have an Android activity with an ImageButton. I would like to execute some logic when the button is clicked and show a different image for the pressed state, but also receive the touch event on the activity.

By default only the button receives the touch event. If I set the clickable attribute of the button to false then only the activity receives the touch event.

What's the best way to implement the touch event in the activity and the click in the button?

View 2 Replies View Related

Android :: How Do I Do A StartActivity In BroadcastReceiver?

Apr 7, 2009

My use case is to launch one of settings app screen when I receive a certain event in idle state. For which, I added my new intent to PhoneAppBroadcastReceiver() in PhoneApp.java (looks like this receiver handles the misc intents) But when i call startActivity(), The phone seems to go into a panic ex. startActivity(new Intent(this, NetworkSetting.class)); My questions are is this the right approach to go about ? If so 1. How can I launch the activity inside of broadcastReceiver? secondly 2. How do i verify if the activity i want to start is already started?Can the NEW_TASK_LAUNCH be used to verify this ,

View 2 Replies View Related

Android :: StartActivity In Another Package

Nov 23, 2009

I have splitted my Android project in 2 packages, lets say: test.current and test.another. From an activity in test.current I want to start an activity in the package test.another

View 6 Replies View Related

Android :: Why Should I Use StartActivity In A Service?

Jul 15, 2010

Why should I use startActivity() in a Service? If I need an Activity a have to call an activity and if I need a "delayed activity" I have to use the notification. So, why should I use startActivity()?

View 1 Replies View Related

Android :: Action Before StartActivity

Jul 22, 2010

I'm new in Android development and I've a problem when I create my new activity.I want to use my activity before start it. For example, But, my "menu" and "MyActivity.class" aren't the same instance.

View 2 Replies View Related

Android :: StartActivity And ActivityNotFoundException

Jun 29, 2009

According to the doc, if the intent in startActivity(intent) is not found, there will be an exception raised. Therefore I use a try/catch block. However, even if I use a random string as the intent, the promised exception does not occur.Instead I see a dialog that says: "No application can perform this function". I also get the same dialog if the intent is valid (picked up by an app) but apparently doesn't want to act when the extras are not what the app expects (e.g. my earlier question about Intent.ACTION_SEND and mime types). I am using the 1.5_r2 SDK on an AVD running 1.5, with the app running at version 1.1 (sdk=2). Is this a doc error, a bug or am I misunderstanding something? Can I simply delete the try/catch block?

View 3 Replies View Related

Android :: StartActivity From Subclass?

May 15, 2009

I have a Activity and I have a class which extends this Activity. In this subclass I call:

startActivity(new Intent(this, CameraView.class))

Which should start the "CameraView" Activity. However, I always get this error:

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

If it makes any difference the subclass creates a ListView and when a row of the ListView is clicked it calls startActivity();

View 5 Replies View Related

Android :: How I Call StartActivity In BradocastReceiver?

Apr 7, 2009

I'd like to launch one of settings app screen when I received a certain event in idle state. For that, I added my new intent to PhoneAppBroadcastReceiver() in PhoneApp.java (because it seems this receiver handles the misc intents) But if I called startActivity(), seems phone goes to panic. ex. startActivity(new Intent(this, NetworkSetting.class));

1. How can I launch the activity inside of bradcastreceiver?

2. If the activity which I want to start is already started, how can I check it? I read can use NEW_TASK_LAUNCH but don't know how to use it. If you have a sample code, could you post it?

View 3 Replies View Related

Android :: What Is Difference Between StartActivity And StartSubActivity?

Mar 3, 2009

what is the scenario that makes me to pick between startActivity and startSubActivity

View 2 Replies View Related

Android :: Way To Pass Bundle On StartActivity?

Apr 20, 2009

What's the correct way to pass a bundle to the activity that is being launched from the current one? Shared properties?

View 2 Replies View Related

Android :: StartActivity() In A Subclass Of Dialog?

Nov 24, 2010

I have one subclass which extends Dialog class, it seems I can not use startActivity() function to start a new Activity in this subclass which extends Dialog class, how to resolve it?

How to start a new Activity in a Dialog subclass? (In my customized dialog subclass, I have one button, when pressed, I would like to have a new Activity start).

View 3 Replies View Related

Android : TabHost And StartActivity For Result?

Sep 2, 2009

I meet an issue: my activity cannot return result.

I created an activity which has one TabHost. I added three tabs using mTabHost.addTab. Every tab will launch an activity(activity A, activity B, activity C). In activity A, it will call startActivityForResult to start activity A1. The issue is activity A cannot get any result after A1 finish.

What is the reason? How should I do if I want to get return value?

View 3 Replies View Related

Android :: Should StartActivity Always Run Started Activities OnCreate?

Aug 10, 2010

I have a main activity and a sub activity.The main activity starts the sub activity using startActivity, and passes an object in the intent.The sub activity reads the object out of the intent in its onCreate action.The sub activity updates the object, then returns to the main activity using startActivity, again passing the updated object back.However, the main activities onCreate function is not called, so the code it contains to read the passed object does not run.Further investigation indicated that the main activity onPause event is firing, i.e. it is only paused when the sub activity runs, so when the sub activity starts the main activity again, it just on Resumes.Does anyone know if there would be any disadvantages if I moved my data restore/store activities to the onResume and onPause events?I'm not using the onCreate saved Instance State, should I be?

View 4 Replies View Related

Android :: Why Does StartActivity Work In One Method And Fail In Another

Aug 17, 2010

I'm struggling to understand why startActivity runs properly when copied from a tutorial I found and fails when I make the smallest change.

Code from the tutorial:

CODE:........

That works. When I try to change it to what I would consider a simpler design, I am getting an error.

CODE:........

The error is: The constructor Intent(FirstTwoApps.ButtonHandler, Class) is undefined

Notice that all I did was moved the action from the handleButtonClick() method to the onClick() method. Apparently that is not allowed, but I don't understand why.

View 2 Replies View Related

Android :: TaskAffinity Causes New Instance Being Created When StartActivity

Jun 9, 2010

I have a problem about taskAffinity of Activity. Activities A and B with the same taskAffinity.

A starts B with FLAG_ACTIVITY_NEW_TASK and the B starts A with FLAG_ACTIVITY_NEW_TASK again. Dumpsys activity of system gives us task stack like below: TOP-> A B A

According to SDK's reference to FLAG_ACTIVITY_NEW_TASK, the result is supposed to be like below: TOP -> A B

If we did not set taskAffinity, A will not be created again but in different task stack from B. (A and B are in different Apps)

After a little more research, we found FLAG_ACTIVITY_REORDER_TO_FRONT is what we want.

My question is whether SDK' reference to FLAG_ACTIVITY_NEW_TASK is wrong?

View 8 Replies View Related

Android : How Can I Prevent Apps From Invoking StartActivity

Oct 15, 2009

I have an Activity X which is only accessible after you've entered a valid credential.

How can I prevent other apps from calling startActivity with an Intent pointing to X?

e.g. Intent intent = new Intent( this, ActivityX.class );
startActivity( intent );

Basically I don't want Activity X to be exported to any apps except my app.

View 1 Replies View Related







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