Android : Way To Use Intent To Update A Value In Another Activity?
Sep 1, 2010
I want to pass a value from one Activity to another to update an integer. So basically I want Activity2 to send Activity1 a value it has garnered from user input. Seems like it should be simple just not sure how. Is it possible to run a function from another Activity and give it this value as an argument?
View 1 Replies
Aug 24, 2009
I have a service that is downloading a file. When the download is done, I would like to update my "Downloaded files" list in my Activity, but only if the Activity is running. I do not want the Activity to start if it's not already running. I was hoping I could do this by making a new Intent with some special flag. Anyone have any idea how I can achieve this? A tiny code example maybe?
View 3 Replies
View Related
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
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
Apr 3, 2010
I'm having difficulties handling multiple instances of my root (main) activity for my application. My app in question has an intent filter in place to launch my application when opening an email attatchment from the "Email" app. My problem is if I launch my application first through the the android applications screen and then launch my application via opening the Email attachment it creates two instances of my root activity. steps: Launch root activity A, press home Open email attachment, intent filter triggers launches root activity A Is it possible when opening the Email attachment that when the OS tries to launch my application it detects there is already an instance of it running and use that or remove/clear that instance?
View 1 Replies
View Related
Nov 2, 2010
Is it possible to get the Activity from an Intent?
View 2 Replies
View Related
Oct 14, 2010
I'm switching between different Activities using Intents. For one Activity, I would like it to clear the history stack so when the user presses the back button, it takes them Home instead of previous activities in my application.
View 2 Replies
View Related
Jun 9, 2009
I've searched for a few hours for a solution to this, so hopefully this isn't a repost I'm setting a shortcut on the Home screen which raises an Intent to my application - the problem is that I don't want to show my app, just run a little code and display a Toast notification. This must be possible - I just can't work out how.. Once I'm handling the shortcut Intent in onCreate() the UI has initialised and I get a little screen flicker if I then run my code and finish().
View 4 Replies
View Related
Jan 2, 2010
I have three classes one main-activity(named MainMap), one non-activity class(named MyItemizedOverlay), and one activity class(named AudioStream). I want to start AudioStream activity from non-activity class but i don't know how to.
View 1 Replies
View Related
May 27, 2010
I am relatively new to android. I have two applications A and B. I have an activity in A, lets name it x, that would launch the application B. Now the intent sent by x contains StringExtra that I want the Starting activity in B to use. Is there a way for the activity in B to do that?
View 2 Replies
View Related
Jul 6, 2010
I need to start an Activity with two different Intent, can I define two Intents In an Activity node?
View 1 Replies
View Related
Nov 6, 2010
I have a server running that notifies the user with a statusbar notification that opens my main activity, how can I pass data to my activity trough that intent?
View 1 Replies
View Related
Aug 2, 2010
In the Activity I write Intent i=new Intent("IntentServiceTest"); Bundle bundle = new Bundle(); bundle.putString("abc", "def"); i.putExtra("wer", bundle); IntentTest.this.startService(i); Start Service into Service OnCreate method,but I don't know how to do get this Intent in this method.
View 11 Replies
View Related
Apr 10, 2009
In my Android application, I have two activity classes. I have a button on the first one and I want to show the second when it is clicked, but I get an error.
Here are the classes:
CODE:...........
The second class that should show when the button is clicked, but never does:
CODE:........
How do I create a button that will show the second activity?
View 3 Replies
View Related
Sep 30, 2010
Android will call onCreate() of my activity whenever it is launched.
In the onCreate() of my activity can I tell what intent launches my activity?
View 1 Replies
View Related
Oct 6, 2010
I want to have an image open from a URL to an intent, most likely the browser or maybe a picture previewer like the one built into twidroyd.I've gotten plain URLs to open to the browser. I just can't figure out what action or category to specify,
View 1 Replies
View Related
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
Jul 2, 2010
My program has a list of tabs that each contain a list of people.Clicking a person should edit their details, but instead, clicking a person throws an ActivityNotFoundException.
View 2 Replies
View Related
Jul 28, 2010
I've got two activities, one of them is called MyActivity. I want both of them to be able to use a function located in a class othat we may call MyClass. In MyClass, I try to use an intent to launch the activity AnotherActivity. Since the constructor takes a context as parameter, I simply tried to store a context from the activity in the constructor, and then use it when I try to create my intent.However, even thought none of the arguments are null (checked that with a simple if-statement), intent seems to be null and a NullPointerException is thrown. Why does it not work, and what can I do to solve the problem?
I'm quite new to Android and Java development, so please explain it as basic as you can.
View 2 Replies
View Related
Aug 16, 2010
I want to create 4(four) tab, on click of each tab i need to call some activity through Intent, upto this is OK, but without replacement of whole page, I would not like to replace tab, tab will remain (unchanged) same for each a every layout/activity, i.e, only lower part (content) parts will change.
View 3 Replies
View Related
Jan 31, 2010
Suppose that I installed app A and app B, app A has a main activity, and app B wants to show that activity by sending a intent. My question is that how android knows I have installed app A and is able to map the intent to its activity? Is there any windows-registry-like store saving such information?
View 1 Replies
View Related
Aug 25, 2010
I have a central activity that can be launched from two separate classes. I was hoping that in this central activity I could have an IF statement like
if(this.getIntent() == MainMenu.class)
{
// Do something here
}
But obviously that isn't legal so how could I structure an expression to check from what class an intent was started.
View 2 Replies
View Related
Nov 29, 2009
I'm trying to start an activity out of a widget so I can't use the startActivity() function. So I'm trying to create the correct intent but I don't find what I'm missing.
View 2 Replies
View Related
Apr 20, 2009
I have an activity that uses a service. While the service is running (it sends some stuff in background) I display a progress bar and disable the send button.
Now I created an Intent to update the interface after the send service has finished. How can I do this only if the activity is still on top? I tried to figure out this in the service with:
CODE:..................
View 4 Replies
View Related
Aug 1, 2010
Is there a way to know which Intent Filter is responsible for launching an Activity which has two Intent Filters defined in AndroidManifest.xml? I want a slightly different set of logic, but not enough that should require a whole new Activity.
View 1 Replies
View Related
Mar 29, 2010
I still have a problem to develop a convenient app to the user. because i am struggling using the activities, intent and intent filters. www.developer.android.com/reference not fit for me to understand these things. can you suggest me a fine example code or tutorial to understand how these things are getting worked.
View 1 Replies
View Related
Aug 18, 2010
I have 2 Activities that need to communicate with each other: ActivityA and ActivityB
Say that ActivityA opens ActivityB. How do I unicast a message from ActivityB to ActivityA without closing ActivityB?
Here's what I tried: setResult() - but the intent will be delivered only when ActivityB closes sendBroadcast() - but this sends the intent to everyone listening to the action.
I only want the action to reach ActivityA since it spawned ActivityB.
I tried having ActivityA registering a BroadCast receiver, but I cannot target that via Intent's SetComponentName(). startActivity() - this brings up ActivityA, which I don't want.
View 1 Replies
View Related
Aug 4, 2010
I am tring to invote internal media player of android from my activity. Seems there is some problem in menifest file .
Please look into this issue .
CODE:...........................
View 2 Replies
View Related
Oct 11, 2010
I am having a problem in running Android unit test. I got this error when I tried to run a simple test.
Here's the log:
CODE:.........................
This error occurs for Android less than 2.2. It works fine for Android 2.2 emulator. Yet Android 2.2 emulator has a bug of sending a key twice even though we only press it one. Application to be tested runs on Android 2.2 platform.
View 1 Replies
View Related
Oct 14, 2010
I've got an activity for which I've defined an intent filter statically in AndroidManifest.xml. I'd like to register additional intents dynamically to that same intent filter in the activity's onStart() method. Is this possible? I'm trying to avoid having to implement a separate intent receiver class.
View 1 Replies
View Related