🙂 İNSANLARIN EN HAYIRLISI INSANLARA FAYDALI OLANDIR 🙂

Ramazan HABER / Android / basık tutunca gelen shortcut ayarlama

1-) Android - basık tutunca gelen shortcut ayarlama

 

kaynak : https://www.youtube.com/watch?v=-uuhUfItN9Y

 

1-> res/xml/shortcuts.xml

 

<shortcuts xmlns:android="http://schemas.android.com/apk/res/android">


    <
shortcut
        
android:shortcutId="compose"
        
android:enabled="true"
        
android:icon="@mipmap/ic_launcher"
        
android:shortcutShortLabel="@string/compose_shortcut_short_label1"
        
android:shortcutLongLabel="@string/compose_shortcut_long_label1"
        
android:shortcutDisabledMessage="@string/compose_disabled_message1">
        <
intent
            
android:action="android.intent.action.VIEW"
            
android:targetPackage="com.di.coffeewens"
            
android:targetClass="com.di.coffeewens.MainActivity" />
        
<!-- If your shortcut is associated with multiple intents, include them
             here. The last intent in the list determines what the user sees when
             they launch this shortcut. -->
        
<categories android:name="android.shortcut.conversation" />
        <
capability-binding android:key="actions.intent.CREATE_MESSAGE" />
    </
shortcut>
    
<!-- Specify more shortcuts here. -->

 

<shortcut
    
android:shortcutId="diger"
    
android:enabled="true"
    
android:icon="@mipmap/ic_launcher"
    
android:shortcutShortLabel="@string/compose_disabled_message2"
    
android:shortcutLongLabel="@string/compose_disabled_message2"
    
android:shortcutDisabledMessage="@string/compose_disabled_message2">
    <
intent
        
android:action="android.intent.action.VIEW"
        
android:targetPackage="com.di.coffeewens"
        
android:targetClass="com.di.coffeewens.MainActivity" />
    
<!-- If your shortcut is associated with multiple intents, include them
         here. The last intent in the list determines what the user sees when
         they launch this shortcut. -->
    
<categories android:name="android.shortcut.conversation" />
    <
capability-binding android:key="actions.intent.CREATE_MESSAGE" />
</
shortcut>

 

</shortcuts>

 

 

 

 

2-> Androidmanifest.xml

 

 <meta-data android:name="android.app.shortcuts"
        
android:resource="@xml/shortcuts" />

</
activity>

 

 2021 Mayıs 30 Pazar
 517