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
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
Oct 7, 2010
I can't find any intent which opens the camera. The closest I've found is ACTION_CAMERA_BUTTON but that breaks if the phone has no hardware button for the camera.
View 3 Replies
View Related
May 2, 2010
im trying to find the code to launch the camera app and I cant figure it out.
View 3 Replies
View Related
Dec 15, 2009
Does anyone know of a shortcut or a way to make a shortcut to launch the video camera app? I hate having to open the camera and try to operate the slider to change the mode to video. The Youtube app works but takes up too much space on the screen. I have BetterCut but have no idea how to make a shortcut to this function
View 2 Replies
View Related
Sep 20, 2010
I am writing a very small app that just opens the camera app ready for video. I am able to get my code to work on an Android 2.2 emulator, but it will not work on my device, Motorola Droid 1 stock 2.2 FRG22D. Any ideas where I went wrong on this code?
CODE:............
It appears ThorstenW is correct. I would upvote your answer if I had enough rep. You can see from the logcat that com.android.camera could not be found and throws a fatal exception. Logcat below.
CODE:...................
View 2 Replies
View Related
Jun 19, 2010
When I use my camera, camcorder, or just open up picture gallery or vid my phone will just restart, no clue why. I told tmobile that and she said it could be my SIM so I get a new one and that doesn't help. I'm about ready to call them and get a new one through my warranty.
View 1 Replies
View Related
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
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 24, 2010
I have a gallery that displays TextViews where the background of each view is the following code...
This selector work just fine for the state_pressed and default (idle) states, but the selected item state is never displayed. I REALLY do not want to force the background of the selected item by changing the background of the view when the onItemSelected event is called. What is the correct state or correct way to get the TextView background to be set properly. Is the selected (center) view in the gallery not really selected? Is there some other state I should put in the selector drawable xml?
View 6 Replies
View Related
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
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
Nov 10, 2010
My Google-Fu is failing this Android newbie today.Does anybody know of a good example showing how to launch an intent from a PreferenceScreen? I want to show a custom LinearLayout that allows me to set some semi-complex preferences.
View 2 Replies
View Related
Jan 13, 2010
What is the recommended way to launch the messaging app (for sending an MMS message) via an intent? The following code works on my HTC Magic ... code..
... but it first launches the Resolver activity (com.android.internal.app.ResolverActivity), prompting the user to select the appropriate app (Email, Gmail, Messaging, Picasa). The user has to select Messaging before proceeding.
The only way I've found to bypass the resolver is to explicity set the desired component on the intent before starting the activity as follows:
intent.setClassName("com.android.mms", "com.android.mms.ui.ComposeMessageActivity");
However, I'm guessing this approach will not work on devices that have a customised UI, like the HTC Hero. Can someone confirm/deny?
I'm also struggling to find official documentation for the "address" and "sms_body" fields that can be supplied as extra data as per the above example. Is it expected that these will be supported by the default messaging app in future SDK versions and in customised UIs (like HTC's Sense UI)?
View 12 Replies
View Related
Mar 3, 2010
I have a question about an intent...
I try to launch the sms app...code...
so, you can see that I put too much things in my intent, but that's because I don't know how I can do...
View 1 Replies
View Related
Aug 12, 2010
Is there any URI which can point to the GMAIL App in android and help me launch it?
View 2 Replies
View Related
Jun 8, 2009
Can you please tell me how can I start an intent to launcher the IM application on android?
View 4 Replies
View Related
Nov 24, 2010
I want to know to launch a satellite application using Intent, i knew how to launch the map application using Intent, but i want to display satellite view rather than map view, my code is uri = Uri.parse("geo:0,0?q=" + VALUE_baraddress1[0] + ", "
+ VALUE_baraddress2[0] + ", "
+ VALUE_baraddress3[0]);
Log.v(TAG, VALUE_baraddress1[0] + ", "
+ VALUE_baraddress2[0] + ", "
+ VALUE_baraddress3[0]);
startActivity(new Intent(Intent.ACTION_VIEW, uri));
View 1 Replies
View Related
Sep 13, 2009
There's seemingly no way to launch the calendar app in a generic way. I've written a widget which allows you to launch the calendar. I use the following Intent:
Intent intent = new Intent(Intent.ACTION_VIEW); intent.setClassName("com.android.calendar", "com.android.calendar.LaunchActivity"); startActivity(i);
However, this doesn't work on the Hero because HTC has apparently replaced the calendar in their Sense UI. I'm looking for a "standard" way to reach the calendar. I'd like for something like this to be standardized:
Intent i = new Intent(Intent.ACTION_VIEW); i.setType("text/calendar"); startActivity(i);
Does anyone think it would be worth trying to add this to the source? It seems like there is a missing chunk of standards around calendar events and/or iCal / vCal support. Does anyone know why?
View 3 Replies
View Related
Jun 30, 2010
I have found various topics here and elsewhere on creating an intent for sending e-mail and that seems to be pretty straightforward. I'm looking for an intent to just launch any e-mail client the user might have.
Here is the code I've seen for sending an e-mail (posted just for reference, this doesn't serve my needs as I don't want to send a new message):code...
The code above works but isn't flexible in that a user might not be using Gmail but the other built-in e-mail application or a 3rd party e-mail app. I'm looking for an intent that would bring up the chooser in this case so the user can decide which app to launch to read e-mail.
Does anyone know how to accomplish this?
View 2 Replies
View Related
Aug 14, 2010
I'm trying to figure out how to launch an activity in my app from a custom URI such as myapp://myuriactivity I've read a lot about the intent and intent filters in the android references and also read several examples, but for some reason I can't get my simple test to work. Below is my manifest file, can anyone tell me what I'm doing wrong? With the below file, if I open the browser and try to navigate to http://org.test.launchtest it just says the page doesn't exist. Shouldn't this work?
View 1 Replies
View Related
Jan 23, 2010
I wonder if this is a bug. This code works on Android 1.x, but fails on 2.x, generating a SecurityException whose explanation seems to have a null String in it where it means to describe the missing permission:
CODE:.............
I think that perhaps the issue is that the classname's prefix (com.android.camera) is not the same as the package name (com.android.gallery).
Can someone comment on what permission (if any) would actually permit this to work on Android 2.x?
The code is thuslike:
CODE:......................
View 5 Replies
View Related
Jun 13, 2009
Can you please tell me how can I launch the intent to pick image from SD card?
View 6 Replies
View Related
Jun 1, 2010
I have the url of an image. What i need to do is launch the default image viewer for images using an intent. But it doesn't work. If I do not specify the type of data, the intent launches the browser since the data is a url. It works basically (since you can see the image on the browser) but what I would like is to have the gallery display the image for me.I can also download the image into a Bitmap but I would still not know how to display the Bitmap using the gallery (if that's even possible).I tried saving the bitmap to the cache and then launch the viewer on that file but it doesn't work. Can you spot any mistakes on my code? (The Utilities class is a class i wrote.
View 3 Replies
View Related
Jun 29, 2009
I am trying to launch an email intent with an attached jpg. I did:
Intent intent4 = new Intent(Intent.ACTION_SENDTO,
Uri.fromParts("mailto", "testemail@gmail.com", null));
startActivity(intent4);
this launches the email activity.
But when I try to add DataAndType (my jpeg attachment). It fails with
android.content.ActivityNotFoundException: No Activity found to handle Intent { action=android.intent.action.SENDTO data=file:///data/data/com.mycompany.mypackage/files/temp-picture type=JPEG
Intent intent4 = new Intent(Intent.ACTION_SENDTO,
Uri.fromParts("mailto", "testemail@gmail.com", null));
intent4.setDataAndType(Uri.parse("file://"+ mTempFilePath),
Bitmap.CompressFormat.JPEG.name());
startActivity(intent4);
View 1 Replies
View Related
Nov 28, 2009
This is what I would like to do: => IF WiFi is enabled AND active, launch an intent (in fact it's a WebView that gets its content=>the instructions of my app on the web) => IF NOT, then I would launch another intent so that I don't show a WebView with "Web page not available ... The Web page at http://www.mywebsite.com might be temporarily down or it may have moved ..."
I tought initially to use
if(wifi.isWifiEnabled())
but that does not say if the Wifi connection is ACTIVE or not. It says only that the user has turned the switch on. The device may or may not be connected... Is this correct ?
Then I tried to use :........................
View 4 Replies
View Related
May 23, 2010
I have developed a very simple widget that was meant to interact with the user via an ImageButton. What I am trying to do now is as follows. When a user taps the button (after adding the widget to their home screen), I want the phone to dial a certain telephone number.
View 2 Replies
View Related
Jun 28, 2010
I'm launching a webbrowser via an intent, which allows my app user to login to Google Docs in a 2-legged oauth dance. This works fine, and the browser callback comes to my app with the right authentication string.
I just want to be able to kill that browser window once we are done - having it sitting there is confusing and messy.
How can I kill a browser window I started up?
View 2 Replies
View Related
Jul 19, 2010
Is there any way to launch an activity w/ Intents (in this case the Browser) in the background, and then bring it to the foreground using a service or activity?
I know it's possible to bring apps to the foreground by launching an intent with FLAG_ACTIVITY_BROUGHT_TO_FRONT
But is it possible to initially launch the activity in the background?
View 3 Replies
View Related
Apr 20, 2009
what is intent action name(e.g. action name "android.media.action.IMAGE_CAPTURE" for launching camera appl) to launch the native map appl Is there intent available(documented or undocumented since above intent of capturing image is undocumented ) for launching maps appl?
I know one for launching maps for driving direction "this.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://maps.google.com/maps? f=d&saddr=37.4,-121.9"+ "&daddr=Bellevue, WA&hl=en")));" but this goes to driving direction page of maps appl.
is there any way to launch maps appl which will open maps home page?
View 3 Replies
View Related