Java tutorial
//package com.java2s; /** * @copyright Copyright (C) 2011 Asela Leelaratne * @license GNU/GPL Version 3 * * This Application is released to the public under the GNU General Public License. * * GNU/GPL V3 Extract. * 15. Disclaimer of Warranty. * THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. * EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES * PROVIDE THE PROGRAM AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE * PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL * NECESSARY SERVICING, REPAIR OR CORRECTION. */ import android.content.Context; import android.content.Intent; public class Main { public static void ShareApplication(Context mContext) { Intent intent = new Intent(android.content.Intent.ACTION_SEND); intent.setType("text/plain"); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET); intent.putExtra(Intent.EXTRA_SUBJECT, "Search Sri Lanka Railway Time Table"); intent.putExtra(Intent.EXTRA_TITLE, "Search Sri Lanka Railway Time Table"); intent.putExtra(Intent.EXTRA_TEXT, "Search \"Sri Lanka Railway Time Table\" on your Android. http://market.android.com/details?id=com.aselalee.trainschedule"); mContext.startActivity(Intent.createChooser(intent, "Spread the word")); return; } }