¡@

Home 

2014/10/16 ¤W¤È 08:21:40

android Programming Glossary: putextra

How to send parameters from a notification-click to an activity?

http://stackoverflow.com/questions/1198558/how-to-send-parameters-from-a-notification-click-to-an-activity

opens my activity in a special mode. I have tried to use putExtra on my intent but cant seem to extract it so i think im doing.. new Intent context Main.class notificationIntent.putExtra item_id 1001 HERE I PUT THE EXTRA VALUE PendingIntent contentIntent..

Android ACTION_IMAGE_CAPTURE Intent

http://stackoverflow.com/questions/1910608/android-action-image-capture-intent

extra and returns the small Bitmap image. However if we putExtra EXTRA_OUTPUT ... on the intent before starting it everything.. if hasImageCaptureBug i.putExtra android.provider.MediaStore.EXTRA_OUTPUT Uri.fromFile new File.. Uri.fromFile new File sdcard tmp else i.putExtra android.provider.MediaStore.EXTRA_OUTPUT android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI..

How to send an object from one Android Activity to another using Intents?

http://stackoverflow.com/questions/2139134/how-to-send-an-object-from-one-android-activity-to-another-using-intents

of a custom type from one Activity to another using the putExtra method of the class Intent android android intent android activity.. it's just a matter of putting them into your Intents with putExtra Intent i new Intent i.putExtra name_of_extra myParcelableObject.. them into your Intents with putExtra Intent i new Intent i.putExtra name_of_extra myParcelableObject Then you can pull them back..

Android multiple email attachments using Intent

http://stackoverflow.com/questions/2264622/android-multiple-email-attachments-using-intent

working when email has a single attachment. I used Intent.putExtra android.content.Intent.EXTRA_STREAM uri to attach the designated.. images attached to the same mail by calling Intent.putExtra android.content.Intent.EXTRA_STREAM uri multiple times it failed.. to declare intent with ACTION_SEND_MULTIPLE then call putExtra EXTRA_STREAM uri multiple times to attach multiple images but..

How to pass object from one activity to another in Android

http://stackoverflow.com/questions/2736389/how-to-pass-object-from-one-activity-to-another-in-android

then you can pass object instances in intent extra using putExtra Serializable.. variant of the Intent#putExtra method. PSEUDO.. extra using putExtra Serializable.. variant of the Intent#putExtra method. PSEUDO code to pass intent.putExtra MyClass obj to retrieve.. of the Intent#putExtra method. PSEUDO code to pass intent.putExtra MyClass obj to retrieve object in second Activity getIntent..

getExtra from Intent launched from a pendingIntent

http://stackoverflow.com/questions/2882459/getextra-from-intent-launched-from-a-pendingintent

at the given time. My problem is that the showname that a putExtra on my Intent cant be received at the broadcast receiver. It.. showname showname This is the value I want to pass intent.putExtras c PendingIntent pendingIntent PendingIntent.getBroadcast this..

ACTION_SENDTO for sending an email

http://stackoverflow.com/questions/3132889/action-sendto-for-sending-an-email

mailto myemail@gmail.com intent.setData uri intent.putExtra subject my subject intent.putExtra body my message startActivity.. uri intent.putExtra subject my subject intent.putExtra body my message startActivity intent android activity android.. share improve this question If you use ACTION_SENDTO putExtra does not work to add subject and text to the intent. Use setData..

Android: Pass data from Activity to Service using an Intent

http://stackoverflow.com/questions/3293243/android-pass-data-from-activity-to-service-using-an-intent

new Bundle mBundle.extras.putString key value mIntent.putExtras mBundle 3 Use the putExtra shortcut method of the Intent Intent.. key value mIntent.putExtras mBundle 3 Use the putExtra shortcut method of the Intent Intent mIntent new Intent this.. Intent mIntent new Intent this Example.class mIntent.putExtra key value New Context can be Activity Service etc Intent myIntent..

Sending arrays with Intent.putExtra

http://stackoverflow.com/questions/3848148/sending-arrays-with-intent-putextra

arrays with Intent.putExtra I have an array of integers in the activity A int array 1 2.. to the activity B so i create a new intent and use the putExtra method Intent i new Intent A.this B.class i.putExtra numbers.. the putExtra method Intent i new Intent A.this B.class i.putExtra numbers array startActivity i In the activity B i get the info..

Android - How to pass HashMap<String,String> between activities?

http://stackoverflow.com/questions/4992097/android-how-to-pass-hashmapstring-string-between-activities

which means they can be passed as Extras inside Intent Use putExtra String key Serializable obj to insert the HashMap and on the..

How to use putExtra() and getExtra() for string data

http://stackoverflow.com/questions/5265913/how-to-use-putextra-and-getextra-for-string-data

to use putExtra and getExtra for string data Can someone please tell me how.. Can someone please tell me how exactly to use getExtra and putExtra for Intent. Actually I have a string variable say str which.. SecondScreen.class String keyIdentifer null i.putExtra strName keyIdentifer and then in the SecondScreen.java public..

Custom filtering of intent chooser based on installed Android package name

http://stackoverflow.com/questions/5734678/custom-filtering-of-intent-chooser-based-on-installed-android-package-name

Parcelable of Intent or LabeledIntent objects as set with putExtra String Parcelable of additional activities to place a the front..

How to pass ArrayList<HashMap<String, String>>from one activity to another

http://stackoverflow.com/questions/6355787/how-to-pass-arraylisthashmapstring-stringfrom-one-activity-to-another

in advance android share improve this question Use putExtra String Serializable to pass the value in an Intent and getSerializableExtra.. arl new ArrayList HashMap String String arl.add hm intent.putExtra arraylist arl startActivityForResult intent 500 Retrieve the..

Get Path and Filename from Camera intent result

http://stackoverflow.com/questions/7636697/get-path-and-filename-from-camera-intent-result

android.provider.MediaStore.ACTION_IMAGE_CAPTURE intent.putExtra MediaStore.EXTRA_OUTPUT outputFileUri startActivityForResult.. android.provider.MediaStore.ACTION_IMAGE_CAPTURE intent.putExtra MediaStore.EXTRA_OUTPUT outputFileUri startActivityForResult.. on gallery folder and after on the file you especified on putExtra MediaStore.EXTRA_OUTPUT path method. You can obtain the last..

Passing a Bundle on startActivity()?

http://stackoverflow.com/questions/768969/passing-a-bundle-on-startactivity

new Bundle mBundle.extras.putString key value mIntent.putExtras mBundle 3 Use the putExtra shortcut method of the Intent Intent.. key value mIntent.putExtras mBundle 3 Use the putExtra shortcut method of the Intent Intent mIntent new Intent this.. Intent mIntent new Intent this Example.class mIntent.putExtra key value Then in the launched Activity you would read them..

Android get previous activity

http://stackoverflow.com/questions/8119526/android-get-previous-activity

activity share improve this question You can use the putExtra attribute of the Intent to pass the name of the Activity. Calling.. Activity Intent intent new Intent this Next.class intent.putExtra activity first startActivity intent Next Activity Intent intent..

Send email via gmail

http://stackoverflow.com/questions/8284706/send-email-via-gmail

i new Intent Intent.ACTION_SEND i.setType text plain i.putExtra Intent.EXTRA_EMAIL new String to i.putExtra Intent.EXTRA_SUBJECT.. text plain i.putExtra Intent.EXTRA_EMAIL new String to i.putExtra Intent.EXTRA_SUBJECT subject i.putExtra Intent.EXTRA_TEXT msg.. new String to i.putExtra Intent.EXTRA_SUBJECT subject i.putExtra Intent.EXTRA_TEXT msg try startActivity Intent.createChooser..

Send Email Intent

http://stackoverflow.com/questions/8701634/send-email-intent

Intent Intent.ACTION_SEND intent.setType text html intent.putExtra Intent.EXTRA_EMAIL emailaddress@emailaddress.com intent.putExtra.. Intent.EXTRA_EMAIL emailaddress@emailaddress.com intent.putExtra Intent.EXTRA_SUBJECT Subject intent.putExtra Intent.EXTRA_TEXT.. intent.putExtra Intent.EXTRA_SUBJECT Subject intent.putExtra Intent.EXTRA_TEXT I'm email body. startActivity Intent.createChooser..

How to send parameters from a notification-click to an activity?

http://stackoverflow.com/questions/1198558/how-to-send-parameters-from-a-notification-click-to-an-activity

want the notification to have an intent that when clicked it opens my activity in a special mode. I have tried to use putExtra on my intent but cant seem to extract it so i think im doing it wrong. Code from my service that creates the Notification.. 100 0 false notif.contentView contentView Intent notificationIntent new Intent context Main.class notificationIntent.putExtra item_id 1001 HERE I PUT THE EXTRA VALUE PendingIntent contentIntent PendingIntent.getActivity context 0 notificationIntent..

Android ACTION_IMAGE_CAPTURE Intent

http://stackoverflow.com/questions/1910608/android-action-image-capture-intent

picture. It works just fine if we leave out the EXTRA_OUTPUT extra and returns the small Bitmap image. However if we putExtra EXTRA_OUTPUT ... on the intent before starting it everything works until you try to hit the Ok button in the camera app... that checks for the bug. Intent i new Intent android.provider.MediaStore.ACTION_IMAGE_CAPTURE if hasImageCaptureBug i.putExtra android.provider.MediaStore.EXTRA_OUTPUT Uri.fromFile new File sdcard tmp else i.putExtra android.provider.MediaStore.EXTRA_OUTPUT.. if hasImageCaptureBug i.putExtra android.provider.MediaStore.EXTRA_OUTPUT Uri.fromFile new File sdcard tmp else i.putExtra android.provider.MediaStore.EXTRA_OUTPUT android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI startActivityForResult..

How to send an object from one Android Activity to another using Intents?

http://stackoverflow.com/questions/2139134/how-to-send-an-object-from-one-android-activity-to-another-using-intents

Activity to another using Intents How can I pass an object of a custom type from one Activity to another using the putExtra method of the class Intent android android intent android activity share improve this question If you're just passing.. approach . Once you have your objects implement Parcelable it's just a matter of putting them into your Intents with putExtra Intent i new Intent i.putExtra name_of_extra myParcelableObject Then you can pull them back out with getParcelableExtra.. objects implement Parcelable it's just a matter of putting them into your Intents with putExtra Intent i new Intent i.putExtra name_of_extra myParcelableObject Then you can pull them back out with getParcelableExtra Intent i getIntent MyParcelable..

Android multiple email attachments using Intent

http://stackoverflow.com/questions/2264622/android-multiple-email-attachments-using-intent

file etc using Intent with ACTION_SEND . The program is working when email has a single attachment. I used Intent.putExtra android.content.Intent.EXTRA_STREAM uri to attach the designated image file to the mail and it is working fine the mail.. delivered through the Gmail. However when I tried to have multiple images attached to the same mail by calling Intent.putExtra android.content.Intent.EXTRA_STREAM uri multiple times it failed to work. None of the attachment show up in the email. I.. could not figure out the correct usage for this command. I tried to declare intent with ACTION_SEND_MULTIPLE then call putExtra EXTRA_STREAM uri multiple times to attach multiple images but I got the same erroneous result just like before none of the..

How to pass object from one activity to another in Android

http://stackoverflow.com/questions/2736389/how-to-pass-object-from-one-activity-to-another-in-android

your custom class implement Serializable interface and then you can pass object instances in intent extra using putExtra Serializable.. variant of the Intent#putExtra method. PSEUDO code to pass intent.putExtra MyClass obj to retrieve object.. interface and then you can pass object instances in intent extra using putExtra Serializable.. variant of the Intent#putExtra method. PSEUDO code to pass intent.putExtra MyClass obj to retrieve object in second Activity getIntent .getSerializableExtra..

getExtra from Intent launched from a pendingIntent

http://stackoverflow.com/questions/2882459/getextra-from-intent-launched-from-a-pendingintent

with a time from a list and create a notification for it at the given time. My problem is that the showname that a putExtra on my Intent cant be received at the broadcast receiver. It always get null value. This is the way I do it for most of my.. this alarmreceiver.class Bundle c new Bundle c.putString showname showname This is the value I want to pass intent.putExtras c PendingIntent pendingIntent PendingIntent.getBroadcast this 12345 intent 0 AlarmManager alarmManager AlarmManager getSystemService..

ACTION_SENDTO for sending an email

http://stackoverflow.com/questions/3132889/action-sendto-for-sending-an-email

v Intent intent new Intent Intent.ACTION_SENDTO Uri uri Uri.parse mailto myemail@gmail.com intent.setData uri intent.putExtra subject my subject intent.putExtra body my message startActivity intent android activity android intent share improve.. Uri uri Uri.parse mailto myemail@gmail.com intent.setData uri intent.putExtra subject my subject intent.putExtra body my message startActivity intent android activity android intent share improve this question If you use ACTION_SENDTO.. startActivity intent android activity android intent share improve this question If you use ACTION_SENDTO putExtra does not work to add subject and text to the intent. Use setData and the Uri tool add subject and text. This example works..

Android: Pass data from Activity to Service using an Intent

http://stackoverflow.com/questions/3293243/android-pass-data-from-activity-to-service-using-an-intent

Intent mIntent new Intent this Example.class Bundle mBundle new Bundle mBundle.extras.putString key value mIntent.putExtras mBundle 3 Use the putExtra shortcut method of the Intent Intent mIntent new Intent this Example.class mIntent.putExtra.. this Example.class Bundle mBundle new Bundle mBundle.extras.putString key value mIntent.putExtras mBundle 3 Use the putExtra shortcut method of the Intent Intent mIntent new Intent this Example.class mIntent.putExtra key value New Context can be.. mBundle 3 Use the putExtra shortcut method of the Intent Intent mIntent new Intent this Example.class mIntent.putExtra key value New Context can be Activity Service etc Intent myIntent getIntent this getter is just for example purpose can..

Sending arrays with Intent.putExtra

http://stackoverflow.com/questions/3848148/sending-arrays-with-intent-putextra

arrays with Intent.putExtra I have an array of integers in the activity A int array 1 2 3 And i want to send that variable to the activity B so i create.. the activity A int array 1 2 3 And i want to send that variable to the activity B so i create a new intent and use the putExtra method Intent i new Intent A.this B.class i.putExtra numbers array startActivity i In the activity B i get the info Bundle.. variable to the activity B so i create a new intent and use the putExtra method Intent i new Intent A.this B.class i.putExtra numbers array startActivity i In the activity B i get the info Bundle extras getIntent .getExtras int arrayB extras.getInt..

Android - How to pass HashMap<String,String> between activities?

http://stackoverflow.com/questions/4992097/android-how-to-pass-hashmapstring-string-between-activities

All Collections objects implement Serializable sp interface which means they can be passed as Extras inside Intent Use putExtra String key Serializable obj to insert the HashMap and on the other acitivity use getIntent .getSerializableExtra String..

How to use putExtra() and getExtra() for string data

http://stackoverflow.com/questions/5265913/how-to-use-putextra-and-getextra-for-string-data

to use putExtra and getExtra for string data Can someone please tell me how exactly to use getExtra and putExtra for Intent. Actually I.. to use putExtra and getExtra for string data Can someone please tell me how exactly to use getExtra and putExtra for Intent. Actually I have a string variable say str which stores some string data. Now I want to send this data from one.. one activity to the other activity. Intent i new Intent FirstScreen.this SecondScreen.class String keyIdentifer null i.putExtra strName keyIdentifer and then in the SecondScreen.java public void onCreate Bundle savedInstanceState super.onCreate savedInstanceState..

Custom filtering of intent chooser based on installed Android package name

http://stackoverflow.com/questions/5734678/custom-filtering-of-intent-chooser-based-on-installed-android-package-name

is Intent.EXTRA_INITIAL_INTENTS . Its description is A Parcelable of Intent or LabeledIntent objects as set with putExtra String Parcelable of additional activities to place a the front of the list of choices when shown to the user with a ACTION_CHOOSER...

How to pass ArrayList<HashMap<String, String>>from one activity to another

http://stackoverflow.com/questions/6355787/how-to-pass-arraylisthashmapstring-stringfrom-one-activity-to-another

is shown as follows ArrayList HashMap String String Thanks in advance android share improve this question Use putExtra String Serializable to pass the value in an Intent and getSerializableExtra String method to retrieve the data. Passing.. String hm.put sunil sahoo ArrayList HashMap String String arl new ArrayList HashMap String String arl.add hm intent.putExtra arraylist arl startActivityForResult intent 500 Retrieve the data in Activity B ArrayList HashMap String String arl ArrayList..

Get Path and Filename from Camera intent result

http://stackoverflow.com/questions/7636697/get-path-and-filename-from-camera-intent-result

Uri outputFileUri Uri.fromFile file Intent intent new Intent android.provider.MediaStore.ACTION_IMAGE_CAPTURE intent.putExtra MediaStore.EXTRA_OUTPUT outputFileUri startActivityForResult intent TAKE_PICTURE it does not store the image as test.jpg.. Uri outputFileUri Uri.fromFile file Intent intent new Intent android.provider.MediaStore.ACTION_IMAGE_CAPTURE intent.putExtra MediaStore.EXTRA_OUTPUT outputFileUri startActivityForResult intent TAKE_PICTURE When I try this it stores the image to.. this question The picture will be stored twice first on gallery folder and after on the file you especified on putExtra MediaStore.EXTRA_OUTPUT path method. You can obtain the last picture taken doing that Gets the last image id from the media..

Passing a Bundle on startActivity()?

http://stackoverflow.com/questions/768969/passing-a-bundle-on-startactivity

Intent mIntent new Intent this Example.class Bundle mBundle new Bundle mBundle.extras.putString key value mIntent.putExtras mBundle 3 Use the putExtra shortcut method of the Intent Intent mIntent new Intent this Example.class mIntent.putExtra.. this Example.class Bundle mBundle new Bundle mBundle.extras.putString key value mIntent.putExtras mBundle 3 Use the putExtra shortcut method of the Intent Intent mIntent new Intent this Example.class mIntent.putExtra key value Then in the launched.. mBundle 3 Use the putExtra shortcut method of the Intent Intent mIntent new Intent this Example.class mIntent.putExtra key value Then in the launched Activity you would read them via String value getIntent .getExtras .getString key NOTE Bundles..

Android get previous activity

http://stackoverflow.com/questions/8119526/android-get-previous-activity

i want to know from which activity page was called. android activity share improve this question You can use the putExtra attribute of the Intent to pass the name of the Activity. Calling Activity Intent intent new Intent this Next.class intent.putExtra.. of the Intent to pass the name of the Activity. Calling Activity Intent intent new Intent this Next.class intent.putExtra activity first startActivity intent Next Activity Intent intent getIntent String activity intent.getStringExtra activity..

Send email via gmail

http://stackoverflow.com/questions/8284706/send-email-via-gmail

gmail I have a code the fires intent for sending email Intent i new Intent Intent.ACTION_SEND i.setType text plain i.putExtra Intent.EXTRA_EMAIL new String to i.putExtra Intent.EXTRA_SUBJECT subject i.putExtra Intent.EXTRA_TEXT msg try startActivity.. email Intent i new Intent Intent.ACTION_SEND i.setType text plain i.putExtra Intent.EXTRA_EMAIL new String to i.putExtra Intent.EXTRA_SUBJECT subject i.putExtra Intent.EXTRA_TEXT msg try startActivity Intent.createChooser i Send mail... catch.. i.setType text plain i.putExtra Intent.EXTRA_EMAIL new String to i.putExtra Intent.EXTRA_SUBJECT subject i.putExtra Intent.EXTRA_TEXT msg try startActivity Intent.createChooser i Send mail... catch android.content.ActivityNotFoundException..

Send Email Intent

http://stackoverflow.com/questions/8701634/send-email-intent

Email Intent Intent intent new Intent Intent.ACTION_SEND intent.setType text html intent.putExtra Intent.EXTRA_EMAIL emailaddress@emailaddress.com intent.putExtra Intent.EXTRA_SUBJECT Subject intent.putExtra Intent.EXTRA_TEXT.. Intent.ACTION_SEND intent.setType text html intent.putExtra Intent.EXTRA_EMAIL emailaddress@emailaddress.com intent.putExtra Intent.EXTRA_SUBJECT Subject intent.putExtra Intent.EXTRA_TEXT I'm email body. startActivity Intent.createChooser intent.. intent.putExtra Intent.EXTRA_EMAIL emailaddress@emailaddress.com intent.putExtra Intent.EXTRA_SUBJECT Subject intent.putExtra Intent.EXTRA_TEXT I'm email body. startActivity Intent.createChooser intent Send Email The above code opens a dialog showing..