Android :: How To Limit Number Of Same Activity On Stack For Droid App?

May 10, 2010

Is this possible in an Android app? I want to make it so that no matter how many times a user starts activityA, when they hit the back button they will never get more than one occurence of activityA. What I am finding in my current code is that I have only two options 1. I can call finish() in activityA which will prevent it from being accessible via the back button completely, or 2. I do not call finish(), and then if the user starts activityA (n) times during their usage, there will be (n) instances when hitting the back button. Again, I want to have activityA accessible by hitting the back button, but there is no reason to keep multiple instances of the same activity on the stack. Is there a way to limit the number of instances of an activity in the queue to only 1?

Android :: How to limit number of same Activity on stack for droid app?


Android :: Stack Of Activity From Activity Stack

Nov 2, 2009

There is a stack of activity i want to call the activity from that stack , My question is that is it possible to check from that stack and call that intent.When i press home button and again when i press the executable it should start the activity where i have left .Is it possible?Any example related to the same would be great help

View 3 Replies View Related

Android :: Way To Limit Number Of Words That Can Be Entered In Droid EditText View

Nov 6, 2010

What's a good way to limit the number of words that can be entered in an android EditText view?

View 1 Replies View Related

Android :: Way To Manipulate The Droid Activity Stack?

Jun 23, 2010

1 - User opens app for the first time ever from android home screen User is presented with "first time" screen (backed by first time activity, lets call it A) User hits back button user is returned to android home screen 2 - User opens app for second time User is presented with the main list screen of the application (backed by a list activity, let's call it B) User hits back button User is returned to android home screen I'm already aware of numerous ways to detect whether it's the first time opening the app or not. The problem is in having the back button return to the home screen rather than a routing activity that decides which screen to forward to.

View 1 Replies View Related

Android :: Way To Visualize Activity Stack (activities In Memory) On Droid?

Jun 26, 2010

I'm currently debugging my app which is quite complex and has up to 5 activity levels. In order to detect memory leaks (i.e. activities that aren't removed from memory even finish() is called, due to some references held somewhere) I want to check which activities are still alive in memory. Currently I create hprof dumps, but it's not very convenient, cause every time I need to mount the sdcard, copy the hprof dump file from the sdcard to my PC, etc. (Side note: I already tried to automate the pulling of my hprof file more easily, but I'm on an unrooted device and adb pull <hprof file> won't let me / no permission.) Therefore I am wondering, if all I want to know is IF and WHICH activities are still currently alive in my memory, is there a way through the Android API or any other way on-the-fly with which I can achieve this (list all alive activities of my app), programatically.

View 2 Replies View Related

Android :: How To Access Droid Activity Stack From Asynchronous Thread?

Sep 26, 2010

There are a ton of activity stack related questions on StackOverflow, but I didn't really see any that answered the question I have. I'm working on an online game that (for now) has 3 different activities Login/Register Menu (seen when logged in, includes "new game", "my stats", and a few other things...I'm just worried about the "new game" option for now.

View 1 Replies View Related

Android :: How To Clear Activity Stack If Using Same Activity Multiple Times?

Mar 3, 2010

So I have an app with Activity A. The layout on the activity is dynamic genearted. So it's possible that on Activity A a user hits a button that goes to "A" and the new page looks different, then a user clicks another button to go to "A" again. Now I have 2 Activities in the history stack. A, A, and currently on A. Is it possible that if a user clicks a button that the whole Activity stack is cleared in a scenario such as this?

View 5 Replies View Related

Android :: Finish Any Previous Activity In Stack From Current Activity?

Apr 27, 2010

How to finish any previous activity in application stack (at any level , I mean not immediate parent) , from current activity like on some particular event I want to invalidate this previous activity?

View 1 Replies View Related

Android :: Retain Only One Copy Of An Activity On Stack When Called From Non Activity

Jul 26, 2010

How can I make sure I only retain one copy of an activity on the stack when called from non-activity? When called from an activity I can just add the FLAG_ACTIVITY_REORDER_TO_FRONT flag to the Intent, but how can I do this from e.g. a widget or a notification?

View 1 Replies View Related

Android :: Way To Skip Parts Of An Activity Stack When Returning Results In Droid?

Oct 16, 2009

I'm making an app which has a flow roughly as below: User starts on the main screen with an empty list, hits menu, and goes to "add item." (Activity A) User is given a new activity which allows them to specify search criteria, then hits "go" to do a search. (Activity B) User gets a list of results, and can click on one of them to view more details. (Activity C) User sees details of item, and can use a menu item to save it to their list in Activity A. (Activity D) Right now, I am having each Activity call each other Activity for results, and then it is passing the result all the way back up the stack as it returns to Activity A. Is there a way to jump this, since all I want is for a result in Activity D to get to Activity A directly? Note that a user should still be able to navigate backwards (using the back button) through each activity, but if they explicitly save the item in Activity D, I want it to jump straight to Activity A.

View 2 Replies View Related

Android :: How To Clear All Activity In Stack Below Latest Activity?

Dec 22, 2009

All the current discussions involves clearing all activites above an existing activyt, but I'm trying to find a way to clear all the activities before the latest activity in the stack. So my scenario is A -> B -> C and then when a user goes to Activity D, activies A,B,C should be cleared from the activity stack. FLAG_ACTIVITY _CLEAR_TOP seems to only clear any activites above an existing activity. Anybody run into this scenario and found a solution?

View 4 Replies View Related

Android :: Clear Activity Stack And Replace With A New Activity

Sep 17, 2009

i want to clear the activity stack and replace it with a new activity as the root activity, even if that activity exists somewhere on the stack (or not). i see FLAG_ACTIVITY_CLEAR_TOP and FLAG_ACTIVITY_NEW_TASK, but it's not obvious to me how to use those in conjunction to achieve what I want. it's like i want to completely restart the task with some activity that i specify as the new root.

View 9 Replies View Related

Android :: Make A Particular Activity As A Root Activity In Stack

Aug 4, 2009

i have a set of activities on my stack Say A-->B-->C. when i launch the activity named 'D' it should get fired as the root activity of my application and all the other activities(A,B,C) should get cleared from my stack once Activity D is launched.Can any one tell me as how to do this

View 4 Replies View Related

Android :: Strange Activity Stack Behavior When Using Map Activity

Apr 23, 2010

I have the following activity structure in my application A simple "splash screen" activity is started when the application is fired up (let's call it "Splash"). This activity starts the main activity when the user presses a button (I will call it "Main"). Main can in turn start two activities from the menu. The first activity presents a simple form (let's call this one "Form"), the second is a MapActivity that presents a map (it is called "Map").
Main, Form, and Map are declared exactly the same in the manifest:
<activity android:name="fully qualified activity class"
android:screenOrientation="landscape"
android:configChanges="keyboard|keyboardHidden|orientation"
> <intent-filter>
<action android:name="android.intent.action.DEFAULT" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter> </activity> When Main is active and I start Form and press "back", Main comes up again. Pressing "back" again brings up "Splash". Nothing strange here.Now comes the strange part: when I am in Main, start Map, and press "back", Main comes up as expected. But pressing "back" again just restarts Main. A second press on "back" is needed to bring me back to Splash!So it seems that starting the Map activity somehow results in Main ending up on the activity stack twice while starting the Form activity does not! Both Form and Map are started like this: start Activity(new Intent(this, MyActivity.class)); I don not catch the back key in any activity.Any clues on what is going on or how to debug this?

View 1 Replies View Related

Android :: Closing More Than One Activity In Activity Stack

Nov 4, 2009

I'm new android and i want to know how to remove more than one activity from stack. We use finish() for closing particular activity but i wanna close more than one activity underneath it, at a time.

View 2 Replies View Related

Android :: Limit To Number Of Touch Inputs In Application?

Jul 26, 2010

I have a small test app on Android that is meant to test tracking multitouch input, but I am only ever getting two touches at the same time on my Evo. Does anyone know if this is a limitation to Android or the hardware? By the way, here's my test class so you can try it out yourself.

import java.util.HashMap; import android.content.Context;
import android.graphics.Canvas; import android.graphics.Color;
import android.graphics.Paint; import android.graphics.Paint.Style;
import android.view.MotionEvent; import android.view.View;
public class PressureView extends View {
private HashMap<Integer, Spot> mSpots = new HashMap<Integer, Spot>();
private final int[] mColors; private final Paint mPaint;
public PressureView(Context context) { super(context);
mPaint = new Paint(); mPaint.setStyle(Style.FILL);
mColors = new int[]{Color.RED, Color.GREEN, Color.BLUE, Color.YELLOW, Color.MAGENTA};

} @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas);
canvas.drawColor(Color.WHITE); for(int id : mSpots.keySet()) {
Spot spot = mSpots.get(id); mPaint.setColor(spot.Color);
canvas.drawCircle(spot.X, spot.Y, spot.Pressure*500, mPaint);
} } @Override public boolean onTouchEvent(MotionEvent event) {
System.out.println("***" + event.getPointerCount() + " Pointers");
for(int i = 0; i < event.getPointerCount(); i++) { int id = event.getPointerId(i);
Spot spot = null; if(mSpots.containsKey(id)) { spot = mSpots.get(id);
} else { spot = new Spot(); spot.Color = mColors[mSpots.size()]; }

if(event.getAction() == MotionEvent.ACTION_UP) spot.Pressure = 0;
else spot.Pressure = event.getPressure(id);
spot.X = event.getX(id); spot.Y = event.getY(id);
mSpots.put(id, spot); } invalidate(); return true;
} private class Spot { public float X, Y, Pressure; public int Color; } }

View 1 Replies View Related

Android :: How Do You Limit Number Of Folders K-9 Mail Displays

Mar 16, 2010

I have a very large number of (corporate) folders in Outlook which I don't want/need to access on my Milestone, but I can't figure out how to stop them being displayed.

View 1 Replies View Related

Android :: Limit For The Number Of Files In Directory On An SD Card?

Apr 16, 2010

I have a project written for Android devices. It generates a large number of files, each day. These are all text files and images. The app uses a database to reference these files.

The app is supposed to clear up these files after a little use (perhaps after a few days), but this process may or may not be working. This is not the subject of this question.

Due to a historic accident, the organization of the files are somewhat naive: everything is in the same directory; a .hidden directory which contains a zero byte .nomedia file to prevent the MediaScanner indexing it.

Today, I am seeing an error reported:

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

Regarding the sdcard, I see it has plenty of storage left, but counting

$ cd /Volumes/NO_NAME/.hidden
$ ls | wc -w
9058

Deleting a number of files seems to have allowed the file creation for today to proceed.

Regrettably, I did not try touching a new file to try and reproduce the error on a commandline; I also deleted several hundred files rather than a handful.

However, my question is: Are there hard limits on filesize or number of files in a directory?
am I even on the right track here?

Nota Bene: The SD card is as-is - i.e. I haven't formatted it, so I would guess it would be a FAT-* format.

The FAT-32 format has hard limits of filesize of 2GB (well above the filesizes I am dealing with) and a limit of number of files in the root directory. I am definitely not writing files in the root directory.

View 3 Replies View Related

Android :: Limit To Number Of Contacts That Can Synch With Gmail?

Jan 7, 2010

I have 9,557 Contacts.

It seems as though I cannot add any new contacts from my phone.... I can only add new contacts from the web (Gmail and/or Google Voice).

Is there some Limit to the number of Contacts that can Synch with Gmail?

(I have a Motorola Droid on Verizon.)

View 4 Replies View Related

Android :: Clear Activity Stack?

Nov 3, 2009

Is there a way to clear our Activity stack? For example, a user in my app progresses through these activities, one is launched from the previous activity: ActivityA -> ActivityB -> ActivityC if the user is now looking at ActivityC, and they hit the back button, they will go back to ActivityB. Is it possible to add a menu to ActivityC where the user can clear their activity stack, and then launch a new instance of ActivityA? This would be so the user can jump to a particular activity in my application without getting confused with the back button + history,

View 4 Replies View Related

Android :: Activity Stack Not Preserved

Mar 10, 2010

My main activity A has as set android:launchMode="singleTask" in the manifest. Now, whenever I start another activity from there, e.g. B and press the HOME BUTTON on the phone to return to the home screen and then again go back to my app, either via pressing the app's button or pressing the HOME BUTTONlong to show my most recent apps it doesn't preserve my activity stack and returns straight to A instead of the expected activity B.Is there a setting I'm missing or is this a bug? If the latter, is there a workaround for this until the bug is fixed?

View 5 Replies View Related

Android :: Way To Navigate Up Activity Stack?

Sep 20, 2010

My understanding is to quit the app I need to call finish() on all activities up to the root activity. However, how do I navigate up activities in app activity stack from current active activity?

View 12 Replies View Related

Android :: Traversing Activity Stack

Sep 1, 2010

how can I assure I always go back clicking on custom menu option to previous activity. I think it is a good idea to start new activities by startActivity(context, XActivity.class) but then when option is selected I should call finish on that activity or again call startActivity(this, previousActivityName)?on the other hand android has all activities on a stack so clicking goback button on a phone I will always go back to previous view, so how can I get this stack.

View 6 Replies View Related

Android :: Removing Stack Of Activity

Jan 7, 2010

I have 5 Activities in sequence Activity1, Activity2, Activity3, Activity4, Activity5.When I am at Activity5 there is a button through I can go to Activity2.Means jump from 5 to 2 with removing the Activity3 & 4.How can I do that?

View 7 Replies View Related

Android :: Resetting Activity Stack

Sep 22, 2009

Activities: A & B are activities that once you have navigated away from them it's not logical that you can get back to them using the back button. C X are activities that follow the usual "can go back to where you came from" flow.App flow: * Launch app from Home -> starts A * From A start B * Finish A (removes it from stack) * From B start C * Finish B (removes it from stack) * From C start D * From D start E.Once the user has reached E, the activity stack looks like this: C -> D -> E. Can I somehow reset the whole stack so it starts again at A so it's as the user just launched it from Home (so that C... E are removed from the history stack)?

View 3 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 :: Is There Way To Print Activity Stack?

Dec 15, 2009

Actually I was trying to automate some stuff on my android emulator. I start an activity through adb shell using "am" command, but when the activity starts do I have a way out to know that my activity is the one which is at the top & has the focus.I googled about it a lot but couldn't find the right way to do this.

View 2 Replies View Related

Android :: Not Understanding Activity Stack?

Dec 3, 2009

I'm having trouble with my activities when they go in the background. I have two activities, A and B. Only A can launch B (manifest copied below).This is very confusing. It's like Android knows my app is running, and puts a new instance of A on top of the old B instance running. I'd just expect that the application gets paused in-place, and whenever the user hits the app icon again, it just picks up where it left off (in this case, just show B again!) Below is the manifest, and the activity classes for this test are completely empty (except A which has a button to launch B).

View 4 Replies View Related

Android :: How To Reuse Activity On Top Of Stack

Jun 16, 2010

My app has a single entry activity called "Main". In "Main" I call one of three other activities A, B, or C (based on a preference) and then immediately exit/finish"Main" so that only A, B, or C are active.I also have a permanent notification in the notification bar that users can pull down (at any time) to conveniently restart my App (calls intent with "Main" component).The problem is that if my app is already running and users pull down the notification and restart, I get A or B or C running on top of the previous activity (also A, or B, or C). How can I avoid this (i.e. reuse the activity on top of the stack)?I've tried Intent.FLAG_ACTIVITY_* and nothing seems to work. I've tried launchModel in the Manifest and it also didn't seem to work.

View 1 Replies View Related

Android :: Access Activity Below In Stack

Sep 8, 2010

I have pushed one Activity to make few changes. Now I want to pass all the changes to the previous(below) Activity. I dont want to create Activity again;and intead i want to access the previous activity.

View 1 Replies View Related







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