Android :: Opening Browser Activity / Prevent It From Being In Activity History

Aug 12, 2010

I'm working on an app that launches the browser activity to perform a Twitter OAuth authorization. This process uses a callback url which will re-launch the activity that started the browser activity in the first place.My problem is that the browser pages remain in the history stack and when the user then clicks back from the preferences activity that launched the browser in the first place, they don't go back to the app's main activity, but instead are brought back to the browser. I've tried adding flags to the launching intent to prevent history and reset on clear, but it doesn't seem to work when running on my phone, only on the emulators.

Android :: Opening browser activity / prevent it from being in activity history


Android :: Prevent Saving Browser Pages In Activity Stack History?

Oct 27, 2010

1. User click one button on Activity#1 to start Activity#2.

2. One button on Activity#2 start system default browser(Intent.ACTION_VIEW) to get Twitter authorized.

3. After user allow, Twitter redirect user to Activity#2(Custom intent- filter+data) and it save the tokens.

Now, if I press back key, the app back to browser, how to prevent this and return to Activity#1? Try several Intent.Flag before start browser with no luck.

View 4 Replies View Related

Android :: Prevent Duplicate Browser / Activity Launching

Jun 29, 2010

I would like to know if there is a way of preventing a duplicate launch of browser/activity, while the user is already focused on it.mybe there is a way to detect before if the user's current screen is already focused on the same activity/browser i intent to launch?

View 2 Replies View Related

Android :: Open Dialogue Activity Without Opening Main Activity Behind It

Jul 19, 2010

Im writing a program that offers a quick reply dialog upon receipt of an SMS.

However, I am getting an unexpected result. When I receieve an SMS, the appropriate dialog activity comes up displaying the correct phone number and message, however there is a second activity behind it that is the 'default' activity in my program (it is what opens when i launch my application)

I do not want this second activity to come up. The quick reply activity should come up by itself over top of whatever the user was doing before.

The 'floating' activity:

CODE:.........

The call to the activity inside an onReceive()

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

The Manifest:

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

View 1 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 :: Main Activity To Browser Activity Error

Nov 7, 2010

I have a main activity, then i call a new activity intent from this. Lets call this SecondActivity. Then from my secont activity i call a browser intent. Then my browser intent call my second activity's onNewIntent method.Evereything work fine, but when i click on "back" button on my phone on my second activity, i will not going to my main activity, but the browsers activity, why?

View 1 Replies View Related

Android :: Opening A Resource Outside An Activity?

Aug 4, 2010

I am trying to open a Resource by passing the result of context.getResources().getString(R.drawable.myimage) to another class that is not an activity. context.getResources().getString(R.drawable.myimage) returns res/drawable-mdpi/myimage.png However, when I try and open this file, it throws a FileNotFoundException. What is the proper way to open a resource outside an activity?

View 1 Replies View Related

Android :: Intent Not Opening Correct Activity

Aug 22, 2010

I'm having a struggle understanding why my intent is not working. I basically just copied paste from other examples in my code that work perfectly like this. Here it is:

Intent addIntent = new Intent(v.getContext(), thenNnowMode.class);
Bundle w = new Bundle(); String activityName = "addPic";
w.putString("activity", activityName);
w.putParcelable("bitmap", selectedDeviceImage);
//a.putString("id", picId); addIntent.putExtras(w);
startActivity(addIntent); finish();

The intent is opening a different class called thenNnow.class instead of thenNnowMode.class and I have no idea why this is happening. I've tried sending the intent to open other activities other than thenNnowMode but it always opens thenNnow. Am I missing some silly syntax mistake? It's so strange, its the same code. I am not sure if it's relevant but the thenNnowMode class uses the device camera

View 23 Replies View Related

Android :: Opening A Second Activity And Fails To Launch?

Apr 12, 2010

What i'm trying to do is to open an Activity when i click on a button.

This is my code in my main activity.

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

The program launches no problem when i just implement the first button (restuarant).

But when i try to implement the button that i have commented out it fails to launch. and yes i have added the activity to the manifest file.

View 1 Replies View Related

Android :: Opening Another Activity From The Map Overlay Dialogs

Jul 22, 2010

I am trying to create a map application and I need to do something similar to what Google Maps does. I want to open show a list of locations and when user taps on them I want to show a dialog.

I was able to do it till here. But now when the user clicks on the dialog that opened I want to show another acttivity with the details of that item that they clicked on.

I tried to start a new intent but it gives me an error.

Here is what I am doing

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

Here is the stack trace

CODE:........

Why am I getting this error and how can I resolve this and open a new activity? Also where can I find the source code for the google maps on android?

View 1 Replies View Related

Android :: Way To Prevent Duplicate Activity?

Nov 30, 2009

I have an Activity which is launched from a Service. This Activity can spawn other children Activities. Now under certain conditions (particularly related to using screen lock), I can end up with the Service starting a second copy of the Activity again. For reasons of performance, the Service is being started and stopped at various times, and cannot be relied on to hold state. What is the best way to prevent this second launch? Can I (for example) detect that the Activity is already running in the stack and do finish()?

View 5 Replies View Related

Android :: How To Add Activity To App To Task History?

Mar 16, 2009

I'm trying to write a mediaplayer activity launched from browser. But I found if I launch mediaplayer activity from browser, it won't be shown in the task history window(long press home key). And if I launch mediaplayer activity launched from home, it can be shown in the task history window. Is there any way to make mediaplayer activity to be shown in the task history window when launching it from the browser activity?

View 2 Replies View Related

Android :: Activity History Stack

Aug 1, 2009

I have 3 activities, I want to allow only one of each of the activities to be on the history stack at one time.A>B>C>[GO TO B] gives me A>C>B using FLAG_ACTIVITY_REORDER_TO_FRONT flag.Now the problem is that when I call B from C I want B to be restarted not just brought to the front.how can I do that?

View 3 Replies View Related

Android :: Avoid History Of Activity?

Oct 13, 2010

I have total 3 activities.
First activity(A) starts second activity(B). From Activity B, 3rd activity(C) is called.

Activity B, shows list with checkbox to select items and single OK button. On clicking OK button Activity C is called with selection.

When user clicks BACK button in Activity C, by default Activity B is displayed (with selected checkbox).

I want to display Activity A when BACK button is clicked in Activity C.

How to achieve that?

I have handled OnKeyDown() in Activity C to startactivity(A). it is working. But when user clicks BACK button on Activity A, again Activity C is displayed. while application should end.

In this direction how to skip Activity B is ever called?

View 1 Replies View Related

Android :: Keep Soft Keyboard From Opening On Activity Launch?

Jun 14, 2010

In an Android app, whenever the activity launches, the textbox gets the focus and the soft keyboard pops up automatically. I have tried to stop this by using following line in onCreate method, but it does not work.

((InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE)).hideSoftInputFromWindow(EditText.getWindowToken(), 0);

View 4 Replies View Related

Android :: Opening A Context Menu In OnCreate Of An Activity

Aug 9, 2010

I have a need to capture some user input when an activity opens for the first time. I'm hoping to give the user a list of options to select from, which will be pulled in dynamically. I'll then store the selected value locally for future use. I'm not finding a way to do what I'm after and was wondering if anyone has run into this before and how they solved it.

Fantasy Football<http://chriswstewart.com/android-applications/fantasy-football/>- Android app for fantasy football fanatics and MFL owners Social Updater<http://chriswstewart.com/android-applications/social-updater/>- An easy way to send your status blast to multiple social networks

View 9 Replies View Related

Android : How To Dynamically Choose Which Activity To Launch When Opening App?

May 5, 2010

I am writing an app that requires you to be logged in to a service before using it. From my understanding of android so far, you have to choose which activity to launch when you open from the launcher in the manifest. I don't know which activity i want to launch at compile time. I want the user to click the icon, then I check and see if they're logged in, then decide based on that whether to launch the login activity, or the main app activity. Is there a way to do this?

View 1 Replies View Related

Android :: Enumerate Activity History Stack

Dec 17, 2009

When debugging I've sometimes wanted a tool that would list running tasks and show which activities are on the history stack for each task. I can get a list of tasks by calling ActivityManager.getRunningTasks(). Each ActivityManager.RunningTaskInfo object in the list gives me interesting information such as the base activity, top activity, and number of activities in the task. I haven't found a way to actually enumerate all the activities in the task's history stack. Is there a way to get at such information?

View 2 Replies View Related

Android :: Remove An Activity From History Stack

Dec 14, 2009

My app shows a signup activity the first time the user runs the app, looks like:

ActivitySplashScreen (welcome to game, sign up for an account?)
ActivitySplashScreenSignUp (great, fill in this info)
ActivityGameMain (main game screen)

so the activities launch each other in exactly that order, when the user clicks through a button on each screen.

When the user goes from activity #2 to #3, is it possible to wipe #1 and #2 off the history stack completely? I'd like it so that if the user is at #3, and hits the back button, they just go to the homescreen, instead of back to the splash screen.

I think I can accomplish this with tasks (ie. start a new task on #3) but wanted to see if there was simpler method.

View 3 Replies View Related

Android :: Status Bar - Opening Correct Activity When Selecting Notification

May 26, 2010

I have been having a problem with a notification not opening/going to the correct activity when it has been clicked. My notification code (located in a class which extends Service):

Context context = getApplicationContext();
CharSequence contentTitle = "Notification";
CharSequence contentText = "New Notification";
final Notification notifyDetails = new Notification(R.drawable.icon, "Consider yourself notified", System.currentTimeMillis());
Intent notifyIntent = new Intent(context, MainActivity.class);
PendingIntent intent = PendingIntent.getActivity(context, 0,notifyIntent, PendingIntent.FLAG_UPDATE_CURRENT | Notification.FLAG_AUTO_CANCEL);
notifyDetails.setLatestEventInfo(context, contentTitle, contentText, intent);
((NotificationManager)getSystemService(NOTIFICATION_SERVICE)).notify(NOTIFICATION_ID, notifyDetails);

If I click the notification while the application which created the service is open, the notification disappears (due to the FLAG_AUTO_CANCEL) but the activity does not switch. If I click the notification from the home screen, the notification disappears and my app is brought to the front, however it remains on the activity which was open before going to the home screen, instead of going to the main screen. How do I specify the activity that will be pulled up?

View 1 Replies View Related

Android :: Prevent Rotation/change Of Orientation In Certain Tab/activity

Sep 11, 2010

My MainActivity (the one that is started by the android application) is a TabActivity which contains several tabs (which are implemented as activities as well). In a certain tab/activity I want to prevent the change of orientation/rotation when the phone is turned. What is the easiest way to achieve this?

View 2 Replies View Related

Android :: Prevent New Activity Instance After Clicking On Notification

Jun 24, 2010

Application (non-wanted) behavior - application is started, some text is put into text-box and notification is created through button action. user "clicks" the home button, application is "minimized", notification is available in bar user selects the notification and the application is "maximized"

BUT - instead of the original instance, new instance is started (e.g. in the newest instance is missing the original text; when the latest instance is closed there is still the original instance with original text ) .

The code of the notification method

CODE:.....

I have also in the manifest xml file following tag android:launchMode="singleTask"

But it is still the same...The main problem is double/triple initialization of the application, i know that there are other means to preserve the values in resumed applications. Also it is needed that the applications stays running in background as the main functionality is the streaming of internet radio.

What is missing in the code ? What kind of information from my side is missing for to troubleshoot the issue ?

View 3 Replies View Related

Android : How To Prevent Multiple Clicks / Activity Starts?

Oct 1, 2010

If I have a button that starts an activity, and the activity sometimes takes a second or two to throw up its own view, how can I most simply and reliably protect against the button being clicked multiple times and kicking off multiple (identical) activities?

View 12 Replies View Related

Android :: Check If Any Items On History / Activity Stack?

Nov 16, 2009

I'm trying to figure out if there's any way to see if there is anything on the history stack so I can programatically display a Back button or not.

I tried getting the RunningTaskInfo to get the num of activities but it doesn't seem to work quite right for what I need. Does anyone know of another way?

View 2 Replies View Related

Android :: Activity History Stack Wrong Upon First Install On Device

Dec 4, 2009

Edit / Update:

As an update to the below problem, I found the exact action which causes it to happen.

Download an apk from a url through the android browser
Install the app.
After install, the app gives you two choices: "Open" or "Done".
If you choose "Open", the quirky behavior described below starts.
If you choose "Done", then launch the app from the app tray, it works fine.

So it seems like this problem is caused by using the "Open" button the browser provides you after installing the APK.

I'm experiencing an error in the history stack of applications upon first install. I made a test app to demonstrate this.

The test app is simply two activities, A and B. Activity A launches B. That's all it does. Rest is wizard generated template code from eclipse.

When the user installs the app (via web url apk), and runs it for the first time, I get an out-of-order activity stack:

-User starts the app, A is on top.
-They make A launch B by clicking a button. B is on top of the stack.
-User hits the home screen button.
-User returns to the app, A is displayed, instead of B.
-User hits the back key, B is shown!
-User hits the back key again, A is shown!
-User hits the back key again, home screen shown.
-Now the stack is clean, and app behaves "normally" from now on!

Is any one else seeing this? This is almost exactly like this known bug, however my users are not installing from eclipse:
http://code.google.com/p/android/issues/detail?id=2373&q=first%20%20i...

I can provide the test app/source if anyone wants to try. This is the manifest, which does not have any special customizations made to it. code...

as far as I know, this should definitely not be happening, and works fine after you clear the history stack the first time.

View 1 Replies View Related

Android :: Intent Filters - Prevent Creation Of Multiple Activity Instances?

Feb 16, 2010

I added an intent filter to one of my activities, so that when a user clicks a URL like "www.mysite.com", and if my app is installed, my registered activity can be launched. It works well.

I see that this creates a new instance of my registered activity though, every time a link is clicked. Is there any way to prevent multiple instances from being created - just recycle an existing instance if one already exists?

View 6 Replies View Related

Android :: Prevent Activity From Saving State When User Selects Back Button

May 2, 2010

I have an Activity with a list that is bound to a ListAdapter reading data into a ArrayList from a database. All is well when the data is first loaded. While the Activity is open and the list is being displayed it is possible and likely that the data in the database will be updated by a service but the list does not reflect the changes because the ArrayList does not know about the changes. If the Activity is no longer in the foreground as would be the case if the user goes to the home screen and then is brought back to the foreground I would like for the Activity to not display what it did prior but rather reload the data using the ListAdapter the view is bound to. I think something needs to call finish() but I am not sure what.

This is what I have in the Activity.

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

View 1 Replies View Related

Android :: On Logout Clear Activity History Stack Preventing Back Button

Jun 9, 2010

All activities in my application require a user to be logged-in to view. Users can log out from almost any activity. This is a requirement of the application. At any point if the user logs-out, I want to send the user to the Login Activity. At this point I want this activity to be at the bottom of the history stack so that pressing the "back" button returns the user to Android's home screen.

I've seen this question asked a few different places, all answered with similar answers (that I outline here), but I want to pose it here to collect feedback. I've tried opening the Login activity by setting its Intent flags to FLAG_ACTIVITY_CLEAR_TOP which seems to do as is outlined in the documentation, but does not achieve my goal of placing the Login activity at the bottom of the history stack, and preventing the user from navigating back to previously-seen logged-in activities. I also tried using android: launchMode ="singleTop" for the Login activity in the manifest, but this does not accomplish my goal either (and seems to have no effect anyway). I believe I need to either clear the history stack, or finish all previously- opened activities. One option is to have each activity's onCreate check logged-in status, and finish() if not logged-in. I do not like this option, as the back button will still be available for use, navigating back as activities close themselves. The next option is to maintain a LinkedList of references to all open activities that is statically accessible from everywhere (perhaps using weak references). On logout I will access this list and iterate over all previously-opened activities, invoking finish() on each one. I'll probably begin implementing this method soon.

I'd rather use some Intent flag trickery to accomplish this, however. I'd be beyond happy to find that I can fulfill my application's requirements without having to use either of the two methods that I've outlined above. Is there a way to accomplish this by using Intent or manifest settings, or is my second option, maintaining a LinkedList of opened activities the best option? Or is there another option that I'm completely overlooking?

View 2 Replies View Related

Android :: Launch The Same Activity From Widget With Different Extras - Prevent Same Instance Show Up After Returned From HOME Button?

Nov 5, 2010

I have a widget that contains 4 buttons to show 4 stock prices, each of them will launch into the same activity Quote.class to show stock details. In onUpdate(), it will set up the pendingIntent with extras with stock symbol. After I hit button A, it goes to Quote activity that shows stock A. Then I hit the BACK button to the homescreen, Quote activity calls onDestroy() and when I hit button B, stock B will show properly. However, when i hit HOME button after it shows stock A, the Quote activity only calls onStop without calling onDestroy(), then as i hit button B, it will call onStart() and it shows the same instance that shows stock A.

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

Originally I thought adding a flag in the Intent should solve this problem. But I have tried
i.setFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK or FLAG_ACTIVITY_NEW_TASK or FLAG_ACTIVITY_NO_HISTORY), none of them makes any difference.

So is there any ways to make it work? How can i remove the history stack from HOME button? How can I call onCreate in Quote activity and get new extras when i hit button B?

View 4 Replies View Related

Android :: Clear Entire History Stack And Start A New Activity On Android

Aug 13, 2010

Is it possible to start an activity on the stack, clearing the entire history before it? The situation I have an activity stack that either goes A->B->C or B->C (screen A selects the users token, but many users only have a single token). In screen C the user may take an action which makes screen B invalid, so the application wants to take them to screen A, regardless of whether it is already in the stack. Screen A should then be the only item on the stack in my application. Notes There are many other similar questions, but I haven't found anything that answers this exact question. I tried calling getParent().finish() - this always results in a null pointer exception. FLAG_ACTIVITY_CLEAR_TOP only works if the activity is already on the stack.

View 1 Replies View Related







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