Apk Verknüpfung erstellen

  • 2 Antworten
  • Letztes Antwortdatum
M

Mathias1000

Neues Mitglied
0
Ich habe in Eclipse eine einfache Java-App programmiert.

Wie kann ich eine Verknüpfung der App auf den Desktop bringen ?
 
Ich glaube er meint eher, wie er eine Verknüpfung seiner App auf dem Homescreen ablegt..
Hier ein Beispiel:

Code:
	    Intent shortcutIntent = new Intent(getApplicationContext(),
	            DeineClass.class);
	     
	    shortcutIntent.setAction(Intent.ACTION_MAIN);
	 
	    Intent addIntent = new Intent();
	    addIntent
	            .putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent);
	    addIntent.putExtra(Intent.EXTRA_SHORTCUT_NAME, "Dein Name");
	    addIntent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE,
	            Intent.ShortcutIconResource.fromContext(getApplicationContext(),
	                    R.drawable.deinicon));
	 
	    addIntent
	            .setAction("com.android.launcher.action.INSTALL_SHORTCUT");
	    getApplicationContext().sendBroadcast(addIntent);
Für diesen Vorgang brauchst du eine weitere Berechtigung die du in der Android Manifest.xml angeben muss:
Code:
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />

Ich hoffe ich konnte dir helfen :)
 

Ähnliche Themen

S
Antworten
7
Aufrufe
1.201
Silvasurf
S
C
Antworten
8
Aufrufe
568
CptGreenwood
C
Jennywise
Antworten
2
Aufrufe
675
Jennywise
Jennywise
Zurück
Oben Unten