


You can use your own image and alter the code to reflect its name. This code refers to an image saved with the file-name "sharing" which is stored the drawable folder of the application resources. This creates a button based on the Android ImageButton class, which the Activity will need to import. tLayoutParams(new ViewGroup.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)) The following Java code creates an image button, inside the "onCreate" method of the Activity: ImageButton sharingButton = new ImageButton(this)

You can launch your sharing Intent on any user action, such as pressing an options or context menu item. Make your class extend the Activity class and include an "onCreate" method in which you can build your user interface elements. Otherwise, you can use the main class for your new app or create a new class, making it an Activity so that you can include a button to launch your sharing Intent. If you already have an Activity in your Android app that you plan on launching the share Intent from, open it in your IDE's editor area. Step 2: Choose an Activity to Launch the Share Intent
