Skip to main content

Android Intents PART-2

1. Launching the Music Player

 Intent myActivity2 = new Intent("android.intent.action.MUSIC_PLAYER");  
 startActivity(myActivity2);  

2. Playing a song stored in the SD card

 Intent myActivity2 = new Intent(android.content.Intent.ACTION_VIEW);  
 Uri data = Uri.parse("file:///sdcard/test.mp3");  
 String type = "audio/mp3";  
 myActivity2.setDataAndType(data, type);  
 startActivity(myActivity2);  

3. Sending MMS
 Uri uri = Uri.parse("content://media/external/images/media/1");  
 Intent i = new Intent(Intent.ACTION_SEND);  
 i.putExtra("address", "555-1234");  
 i.putExtra("sms_body", "some text message");  
 i.putExtra(Intent.EXTRA_STREAM, uri);  
 i.setType("image/png");  
 startActivity(i);  

4. Sending Email
 Uri uri = Uri.parse("mailto:dhaval0122@gmail.com");  
 Intent myActivity2 = new Intent(Intent.ACTION_SENDTO, uri);  
 myActivity2.putExtra(Intent.EXTRA_SUBJECT, "subject goes here");  
 myActivity2.putExtra(Intent.EXTRA_TEXT,"The email's body goes here");  
 startActivity(myActivity2);  

5. Setting System
 Intent intent = new Intent(android.provider.Settings.ACTION_SETTINGS);  
 startActivity(intent);  


6. Setting System Locale: Language & Keyboard

 Intent intent = new Intent(android.provider.Settings.ACTION_LOCALE_SETTINGS);  
 startActivity(intent);  

Comments

Popular posts from this blog

Android - Google MAP V2 PART 1

Download Full Code  of PART-1 , 2 , 3 , 4 Download and configure Google Play Services Library in Eclipse Google Map for Android is now integrated with Google Play Services. So we need to set up Google Play Service Library for developing Google Map application in Android. Get the API key for Google Maps v2: Linux  :  For any other OS use this :  keytool -list -v -alias androiddebugkey \ -keystore <path_to_debug_keystore>debug.keystore \ -storepass android -keypass android Register with the Google APIs Console :    Google APIs Console  Select here the  Services  entry: Activate the  Google Maps Android API v2 . Register your application via its package in this console together with the SHA-1 fingerprint of your signature key. Click on Create new Android Key.. Add you SHA-1 and your package name in to box like example given in alert box. Support library...

Share Text To Facebook & Twitter ANDROID

Shaadi.com Indian Matrimonials Before Create this app you must Have to create Application on FACEBOOK & TWITTER Download Code

Multi-Selection ListView ANDROID with CheckBox PART-2

Check Below Code : mainActivity.java package com.example.listviewcheckbox; import java.util.ArrayList; import android.app.Activity; import android.content.Context; import android.graphics.Bitmap; import android.os.Bundle; import android.util.Log; import android.view.LayoutInflater; import android.view.Menu; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.CheckBox; import android.widget.ImageView; import android.widget.ListView; import android.widget.TextView; import android.widget.Toast; public class MainActivity extends Activity { private ListView listview; ArrayList<String> items = new ArrayList<String>(); private int count; private boolean[] thumbnailsselection; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(...