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
Sep 17, 2010
I am trying to send an MMS like this:
CODE:...........
And when I do that, it throws an "ActivityNotFoundException"
However, I am looking at logcat, and when I share an image from the camera application, it sends this exact same intent. Not sure what I'm missing here.
View 3 Replies
View Related
Nov 13, 2009
I want to change the current activity inside a tab in a tab activity, after some research, I know that I need to use activity group to go this.
Then I created a new class extends ActivityGroup with the code below:
CODE:............
Then I run the program, the program throw the ActivityNotFoundException when the intent for the tab is launched.
View 4 Replies
View Related
Jul 5, 2010
I have a launched android application that works fine most of the time. However 1 in about 1000+ runs I get an android.content.ActivityNotFoundException: Unable to find explicit activity class exception. The activity is declared in my manifest and I've never seen it crash myself. It is declared like this...
CODE:..........
The crash reports show it failing on all OS's from 1.5 to 2.1.
View 2 Replies
View Related
Aug 8, 2010
I am getting this exception while I am trying to call an activity from another one.. .The complete exception is android.content.ActivityNotFoundException:Unable to find explicit activity class {com.x.y/com.x.y.class};
I am doing an intent.setClass("com.x.y","com.x.y.className") where className is the name of my activity class and com.x.y is the package it resides in.
My AndroidManifest.xml has the following content:
View 3 Replies
View Related
Sep 30, 2009
I have some code that starts another activity based on a menu item selection:
..........
I've spent quite a bit of time on this and am inclined to file a bug report at this point. I can see a reference to the allegedly missing class in the classes.dex file inside the APK and the code works properly in the emulator. I haven't been able to find anything like this, so if there is, an RTFM pointer will be humbly accepted.
View 4 Replies
View Related
Jun 23, 2009
The JavaDoc of Context's public abstract void startActivity (Intent intent) said:
This method throws ActivityNotFoundException if there was no Activity found to run the given Intent.
But when I look at the android source code, it does not catch ActivityNotFoundException.
For example in AlarmClock.java:
CODE:..................
what is the code which handles the case when there is no activity for that intent?
View 7 Replies
View Related
Nov 2, 2010
test.class type is right? How to? What should I do?
CODE:...............
View 2 Replies
View Related
Feb 28, 2010
I am trying to start a new activity from a menu action, as follows:
CODE:.............
The class exists, and has the OnCreate method over-ridden, but whenever I try to perform the action in the simulator I get an ActivityNotFoundException raised. I have looked through the documents and as far as I can read, I do not need to create an Intent in the manifest.xml for this to work.
View 3 Replies
View Related
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
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
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
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
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
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
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
Mar 3, 2009
what is the scenario that makes me to pick between startActivity and startSubActivity
View 2 Replies
View Related
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
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.
View 1 Replies
View Related
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
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
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
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
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
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
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
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
Sep 27, 2010
When ever we need to send an email in Android we will invoke registered email application using Intent.ACTION_SEND. like the below
Intent i = new Intent(Intent.ACTION_SEND);
startActivity(Intent.createChooser(i, "Send mail..."));
My doubt is why do we need to use Intent.createChooser in startActivity rather than using
startActivty(i).
Is there any specific reason of using Intent.createChooser()?
View 1 Replies
View Related
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
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