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

Android :: Intent not Opening Correct Activity


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 :: OnActivityResult Intent Data Not Correct

Jul 29, 2010

I'm venturing into startActivityForResult for the first time and I'm running into a problem.When a user clicks on a list item of Activity B, it returns "ql_id" to Activity A:Unfortunately, extras.getInt("ql_id") evaluates to "0". Why is this? It should be "1". I am clearly doing something incorrectly.

View 1 Replies View Related

Android :: Intent For Opening Browser

Apr 12, 2009

Can anyone post me the intent for opening the Browser on the URL specified.?

View 2 Replies View Related

Android :: How To Search PDF After Opening From New Intent?

May 23, 2010

I've used the code from the PDF rendering question
http://stackoverflow.com/questions/2883355/how-to-render-pdf-in-android
And it works! Props to the answerer, but my question is about doing that same thing but also sending a keyword to search in the pdf. I have no idea how to do this, should I set a flag?

View 1 Replies View Related

Android :: What Intent Is Used For Opening Mail Account?

Oct 21, 2010

I just want to know what intent am I going to use to open a mail client. I can open the "compose view" of the mail client but I cant find an intent to open the "inbox view" of the mail client. The same thing for opening the "mail" application from android device. For example, from my application, I want to call "mail" application. What intent should I use for it?

View 4 Replies View Related

Android :: How To Catch Intent For Opening Webpage?

May 21, 2010

I am trying to catch the intent that is fired when someone clicks on a hyperlink to a web page in the MMS browser. I have this in the manifest:

</intent-filter> <intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="http" /> </intent-filter>

However, when I click on http://www.ibm.com it only launches Browser. Same when I do
$ am start -a android.intent.action.VIEW -d http://www.ibm.com
in an adb shell.

View 1 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 :: 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.

View 1 Replies View Related

Android :: Taking Picture By Camera Correct Intent Action

Mar 3, 2009

I am trying to take picture by G1 camera.

I have tried almost everything i was able to find on the net about this topic. It seams there should be intent with action "android.media.action.IMAGE_CAPTURE" which really starts camera application and returns captured image. But captured image is scaled to 0.25 of original size. Another possibility I have found is to pass uri where to save captured image. I went through all available sources of camera application and it should work but does not.

For illustration, I am doing following in my example activity which creates new image, but after returning from camera, image is still empty:

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

I am ready to write my own capturing application, but it is quite hard and I would like to reuse.

Do you know correct intent action name and extra name to pass to capture image?

View 4 Replies View Related

Android :: Correct Intent To Launch Gallery / Video Camera

Jul 28, 2009

My application has buttons to launch gallery and video camera apps but the below code only seems to work on phones with the standard Cupcake build:
// For Gallery Intent intent = new Intent(); intent.setClassName("com.android.camera", "com.android.camera.GalleryPicker");
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); mContext.startActivity(intent);
// For Video Camera Intent intent = new Intent(); intent.setClassName("com.android.camera", "com.android.camera.VideoCamera"); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); mContext.startActivity(intent);

On rooted / non-cupcake phones, I get this error:
android.content.ActivityNotFoundException: Unable to find explicit activity class {com.android.camera/com.android.camera.VideoCamera};
have you declared this activity in your AndroidManifest.xml? at android.app.Instrumentation.checkStartActivityResult (Instrumentation.java:1480) at android.app.Instrumentation.execStartActivity(Instrumentation.java: 1454) at android.app.Activity.startActivityForResult(Activity.java:2656) at android.app.Activity.startActivity(Activity.java:2700)

View 3 Replies View Related

Android :: Intent Action - Correct Way To Get Back To Application After Call?

Aug 27, 2010

I got one question regarding the intent action "ACTION_CALL". What is the correct way of getting back to the own application/activity after the user ends the call? The only way that came to my mind uses a PhoneStateListener in a background services that waits for the CALL_STATE_IDLE event starting up the application again. But I am not quite sure if that is the correct/intended way of using the intent.

View 1 Replies View Related

Android :: Correct Intent Filter Configuration To Associate File Type?

Nov 10, 2010

This question has been asked [numerous times] before, but I have not seen any definitive answers, or examples of code that actually works. I would like to associate an Activity with a particular file type. For discussion, assume that I want my Activity to be associated with PDFs. Here is what I currently have. I have experimented with many different values and combinations of values in the intent-filter, but I have yet to get my Activity to start when a PDF is selected.

<activity name="com.mycompany.MyActivity">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="file" />
<data android:mimeType="application/pdf" />
<data android:pathPattern="*.pdf" />
<data android:host="*" />
</intent-filter> </activity>

View 1 Replies View Related

Android :: Opening Local HTML File Via Browser Intent

Aug 31, 2009

My open source application needs to browse local HTML files on the SD card, and WebView is not enough because I need history and bookmarks. I wrote the following code. It correctly opens the browser, but fails to reach catalog.html and in fact it just opens whatever page was last browsed:

Uri uri = Uri.parse("content://com.android.htmlfileprovider/sdcard/ myapp/catalog.html");
Intent intent = new Intent(); intent.setData(uri); intent.setClassName("com.android.browser", "com.android.browser.BrowserActivity"); startActivity(intent);

View 2 Replies View Related

Android :: Correct Way To Start An Activity?

Feb 16, 2010

Code...

This would start a new activity, and then close the current Activity forever, right?

View 1 Replies View Related

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 :: Launching Correct Activity On Resume

Jan 22, 2010

I'm currently working with a two-activity application. The first activity allows the user to choose options for their upload, and the second activity displays a ListView of their results once processed.I have code in place that performs the uploads/downloads in the background, regardless of whether the application is currently in focus or not (thanks to Matthias Kaeppler's Droid-Fu).I would like to have my application Resume into my second (results) activity when a user clicks on the icon from the top-level launcher, regardless of how long they have been away from the app. I thought that the 'alwaysRetainTaskState' flag in the Manifest would do it, but I've not had success with that. Can anyone tell me how I need to set up my Manifest to get this functionality?

View 19 Replies View Related

Android :: Correct Way To Save State Of An Activity?

Jul 1, 2010

I have an Activity, which contains a bunch of check boxes and a submit button.

When the submit button is clicked, the activity will exit (finish() will be called). Before the activity exits, I want to save the states of the check boxes in the activity, so when the activity starts again, the check boxes can stay in their previous states. What's the correct way to save these states? Should I use SharedPreference.

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 :: 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 :: Retain Application / Activity State Correct Approach?

Dec 22, 2009

I just read from internet to maintain the state of my application by overriding the onKeyDown function as given below. And set the launch mode of my activity as singleInstance. And it is working perfectly. Just want to know if it is correct approach. And how it is different from onSaveInstanceState.

View 3 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 :: After Killing Task Droid Not Launching Correct Activity / What Is Happening?

Aug 19, 2009

Our application is defined to launch a SplashScreenActivity from Intent { action=android.intent.action.MAIN categories= {android.intent.category.LAUNCHER} . After the SplashScreenActivity does its work, it launches another intent to launch MainMenuActivity and finish() is called on SplashScreenActivity.

When we run our app for the first time on our phone, the SplashScreenActivity launches OK, and correctly launches the MainMenuActivity.

However, if we kill the app using TaskKiller, LOGCAT indicates that the application has been killed. I can't debug the app, because launching it from eclipse with the debugger makes it work OK, because it reinstalls the app. Perhaps there is a way to launch the app without reinstalling it?

Here is the Log of us killing our app...

When we launch the application again, the LOG messages for SplashScreenActivity are not logged and it looks from LOGCAT that Android is launching the MainMenuActivity instead. Here is the log...

Can someone Romaine, Diane help us understand what is happening? We saw this happening because some variables are initialized in SplashScreenActivity that aren't available with MainMenuActivity and we were getting NPEs.

View 3 Replies View Related

Android :: Handle Existing Instance Root Activity Launching Root Activity From Intent Filter

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

Android : Way To Get Activity From An Intent?

Nov 2, 2010

Is it possible to get the Activity from an Intent?

View 2 Replies View Related

Android :: Set Root Activity/intent ?

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

Android : Way To Handl An Intent Without Activity UI?

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







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