
kukuk
App-Anbieter (kostenlos)
- 37
Hallo alle miteinander, ich baue gerade APP Shortcuts in meine App ein und bin aktuell bei einem Problem, das ich nicht weiß wie ich rausbekommen kann, welcher Shortcut geklickt wurde. Kann mir da jemand helfen?
Ich habe bei google folgendes gefunden:
Launch Fragment (instead of Activity) from Android 7.1 App Shortcut - android - android-fragments - android-manifest - android-7.1-nougat - app-shortcut - Techqa.info
Allerdings lässt sich das nicht umsetzen.
Wenn ich wie beschrieben dann
android:action="com.appname.custom.shortcut1"
und dann
public void onCreate(Bundle savedInstanceState){
if (com.appname.custom.shortcut1.equals(getIntent().getAction()){
// do Fragment transactions here
}
}
Dann kommt es zu einem Fehler
Error
775, 50) error: package com.arbeitszeit_kalkulator_pro_beta.custom does not exist
Hat jemand eine IDee?
Ich würde gerne wissen welcher Shortcut angeklickt wurde und dann demensprechend meinen Code ausführen.
Ich habe bei google folgendes gefunden:
Launch Fragment (instead of Activity) from Android 7.1 App Shortcut - android - android-fragments - android-manifest - android-7.1-nougat - app-shortcut - Techqa.info
Allerdings lässt sich das nicht umsetzen.
Wenn ich wie beschrieben dann
android:action="com.appname.custom.shortcut1"
und dann
public void onCreate(Bundle savedInstanceState){
if (com.appname.custom.shortcut1.equals(getIntent().getAction()){
// do Fragment transactions here
}
}
Dann kommt es zu einem Fehler
Error

Hat jemand eine IDee?
Ich würde gerne wissen welcher Shortcut angeklickt wurde und dann demensprechend meinen Code ausführen.
Zuletzt bearbeitet: