Skip to main content

Working with Android 7.1 App Shortcuts



Working with Android 7.1 App Shortcuts

Android 7.1 introduced a new feature called App Shortcuts. When you long press your app icon, it shows shortcuts to specific actions which can be launched, on supported launchers. For example, a dialer app can show shortcuts to your recently dialed numbers. A messaging app can show shortcuts to your recent conversations.

In this tutorial, we will create two Activities and add these activities as shortcuts.

Prerequisites


Make sure you have updated your Android SDK to 7.1 and Created a virtual device with Android 7.1 System Image.

creating project


Here I have created an Android Studio project with package com.lagahit.appshortcuts also Activity as MainActivity and layout as activity_main. Our main layout has a Button to launch Profile Activity.

Creating Profile Activity

To the left of Android Studio, you will find Project Explorer. Right Click on the app from the project explorer and select,
New -> Activity -> Empty Activity
Here I have created new Activity as Profile Activity and layout as activity_profile.
It has Text View which displays ProfileActivity.


Creating Shortcuts XML

The shortcuts which to be displayed in the launcher should be defined in an XML file. Let’s create a new shortcuts.xml in res -> xml
It has root element with child element for each shortcut.
Each shortcut should define shortcutId, label, icon and Intent which it wishes to launch

shortcuts.xml


.

Adding Shortcuts to Manifest

Finally this shortcuts.xml should be referenced in manifest’s meta-data.

AndroidManifest.xml


Screenshot


ENJOY

Comments

Popular posts from this blog

Samsung Galaxy S6 Edge Power On Off Key Button Switch Jumper Ways Smartphone Repairing

Samsung Galaxy S6 Edge Power On Off Key Button Switch Jumper Ways Smartphone Repairing Samsung Galaxy S6 Edge charging ok, flash ok, but not powering phone, this mean power button cut/line problem.So now follow simple power button jumper ways. Smartphone Repairing If you are facing an energy problem in Samsung Galaxy S6 Edge diagrams in this article can help. Continue with the following troubleshooting solutions and establish bridges necessary for the points that have been damaged. Samsung Galaxy S6 Edge Dead does not start Solution Samsung Galaxy S6 Edge keys Power Jumper Samsung Galaxy S6 Edge On Off Button Ways Samsung Galaxy S6 Edge power button point Trick damaged bridge. Trace point of damage to the meter or check off switch with a new one. We can check problem button to connect the phone to the charger with mobile entertainment indicator appears on the screen and pressing the power button, then this is a power button problem. See diagram and apply jumpers as diagram. Smar...

Samsung Galaxy Grand Neo I9060 Cell Phone Screen Repair Light Problem Solution Jumper Ways Smartphone Repairing

Samsung Galaxy Grand Neo I9060 Cell Phone Screen Repair Light Problem Solution Jumper Ways Smartphone Repairing This post is all about Samsung Galaxy Grand Neo I9060 fix phone screen problem solution. If mobile phone scree display is not working good or the screen light is not working. Samsung Galaxy Grand Neo I9060 cracked screen repair is only possible with phone screen replacement. But if the screen is not broken then replace phone screen is not required. Smartphone Repairing If Samsung Galaxy Grand Neo I9060 screen is blinking or dim light having blank scree. In all these case we have to disassemble the smart phone and check screen jack if there is any rust carbon or damages of screen jack pins.Samsung Galaxy Grand Neo I9060 phone repair tutorials are given in a few more posts so you can search other repairing problem solutions here. If screen jack have no any fault then the above mobile screen repair diagram will help you to find out tracks that are used in screen functi...

Samsung Galaxy J7 Prime Usb Charging Problem Solution Jumper Ways

Samsung Galaxy J7 Prime Usb Charging Problem Solution Jumper Ways Problem:- Samsung Galaxy J7 Prime usb charge solution, Samsung Galaxy J7 Prime usb not recognized not detected Diagnostic: – Plug the USB cable into the PC and phone jack, read the notifications on the screen phone recognized or not. Make sure you can save data to the memory card or not. Replace the USB data cable and try again. Replace the usb charger and try it again can charge it or not. Solution:- If you are facing a load problem in Samsung Galaxy J7 Prime and have tested all the above steps to solve this problem in it. Dismantle the phone and look at the phone for water and carbon damage. Clean it with an electronic cleaner and apply heat with a heat gun to dry it. Keep in mind the heat should not be over and much because it can harm your skin and damage the motherboard. So keep it in the normal stream and look at the parts carefully. Follow all these paths and components as shown in the diagram abov...