Activity einer anderen App mit result

michael-x

Mitglied
hallo;
wenn ich in derselben App eine zweite Activity aufrufe, die einen Result liefert, muss ich in der Manifestdatei eintragen:
<activity android:name=".UnterActivity />
und den Intent definiere ich mit:
val unter = Intent(this, UnterActivity::class.java)
secondActivityWithResult.launch(unter)
Wie muss ich das abändern, wenn die aufgerufene Actitiy die den Result liefern soll sich nicht in derselben, sondern sich in einer anderen App befindet ?
Die zweite App rufe ich in diesem Fall auf mit:
val pack = "a1.a1.gerufen3"
val unter = packageManager.getLaunchIntentForPackage(pack)!!
secondActivityWithResult.launch(unter)
Was muss ich in der Manifestdatei eintragen, damit ich ich einen Result von der aufgerufenen App empfangen kann ?
Den Result frage ich ab mit:
registerForActivityResult(ActivityResultContracts.StartActivityForResult())
Im ersten Fall wenn die aufgerufene Activity in derselben App ist klappt es. Was muss ich machen wenn die aufgerufene Activity in einer anderen App ist um den Result zu empfangen ?
Danke
 
Zuletzt bearbeitet:

Jw456

Top Contributor
Hallo
Ich hatte dir schon gesagt das dies mit einem Expliziten Intent nicht geht.
Das was du machst ist ein Expliziter Intent und kein Impliziter Intent.

Ein Impliziter hat immer eine Action zb.
Intent intent=new Intent(Intent.ACTION_VIEW);


Die App (Activity) die du starren willst muss genau die Action und Category im Intent-Filter im Manifest haben. In der zustarten App nicht in der aufrufenden App
 

michael-x

Mitglied
danke ich hab jetzt die Lösung in einem anderen Forum bekommen.
so gehts:

val unter = Intent()
unter.setClassName("a1.a1.gerufen3", "a1.a1.gerufen3.MainActivity")

unter.putExtra("uebergabe", B.edit1.text.toString())

secondActivityWithResult.launch(unter)
 
Ähnliche Java Themen
  Titel Forum Antworten Datum
G eine Methode einer anderen Activity aufrufen Android & Cross-Platform Mobile Apps 9
S Android "Weiches wechseln" zwischen Views in einer Activity Android & Cross-Platform Mobile Apps 3
G Daten von einer Activity zur nächsten übergeben Android & Cross-Platform Mobile Apps 6
A Beenden einer 2ten Activity Android & Cross-Platform Mobile Apps 3
W JSONARRAY per Intent an andere Activity übergeben und umwandeln ggbf. Android & Cross-Platform Mobile Apps 1
CT9288 Methode von Fragment durch Activity rufen scheitert Android & Cross-Platform Mobile Apps 7
ruutaiokwu Android Daten von "Activity A" nach "Activity B" umleiten? Android & Cross-Platform Mobile Apps 13
L Android Lockscreen-Sperrmuster activity verwenden Android & Cross-Platform Mobile Apps 1
J Android App stürzt ab wenn neue activity gestartet Android & Cross-Platform Mobile Apps 6
D Android Activity wechseln per Button Android & Cross-Platform Mobile Apps 3
P Android Android-App Crash - Unable to start activity ComponentInfo Android & Cross-Platform Mobile Apps 2
S Neue Activity lässt sich nicht starten Android & Cross-Platform Mobile Apps 28
B Android Activity nach gedrückte Returntaste weiterlaufen lassen Android & Cross-Platform Mobile Apps 2
J Probleme mit ViewPager und Activity Android & Cross-Platform Mobile Apps 1
B Android In einem View der ersten Activity zweite anzeigen Android & Cross-Platform Mobile Apps 2
G Accelerometer ohne Activity Android & Cross-Platform Mobile Apps 8
J Android BroadcastHandler extends BroadcastReceiver; auf Activity zugreifen? Android & Cross-Platform Mobile Apps 5
K Android Übergeordnete Activity herausfinden? Android & Cross-Platform Mobile Apps 7
W Android Designfrage / Layout / Activity / Fragments Android & Cross-Platform Mobile Apps 2
B Login Activity Android & Cross-Platform Mobile Apps 1
M Android Suche Activity/View Namen Android & Cross-Platform Mobile Apps 1
K Unbekannte Menge von Daten (Strings oder Ints) an Activity übergeben Android & Cross-Platform Mobile Apps 0
M Fehler ohne Sinn? java.lang.RuntimeException: Unable to start activity ComponentInfo Android & Cross-Platform Mobile Apps 11
S Android Eclipse erstellt keine main Activity Android & Cross-Platform Mobile Apps 4
B java.lang.RuntimeException: Unable to start activity ComponentInfo Android & Cross-Platform Mobile Apps 2
K Android Activity for result aus Dialog Android & Cross-Platform Mobile Apps 1
D Android Activity mit mehreren Views "spliten" Android & Cross-Platform Mobile Apps 10
G Activity-Wechsel bitte ohne Notification Android & Cross-Platform Mobile Apps 6
D Android Neue Activity im TabWidget laden Android & Cross-Platform Mobile Apps 8
S Android In Service überprüfen ob eine Activity gebunden ist? Android & Cross-Platform Mobile Apps 6
T Android Activity finished testen Android & Cross-Platform Mobile Apps 5
T Activity / Application fundamentals Android & Cross-Platform Mobile Apps 4
M Activity wechseln aus List View mit Android & Cross-Platform Mobile Apps 2
G extends Activity für Berechnungen? Android & Cross-Platform Mobile Apps 7
G selbes Menü auf jeder Activity Android & Cross-Platform Mobile Apps 4
C Activity ohne Aktion starten Android & Cross-Platform Mobile Apps 8
C Android Kommunikation zwischen Service und Activity Android & Cross-Platform Mobile Apps 8
Maxim6394 [ Android ] Activity ändern Android & Cross-Platform Mobile Apps 9
A Activity Intent 'source not found' Android & Cross-Platform Mobile Apps 4
A Android Activity Variablen-Initialisierung Android & Cross-Platform Mobile Apps 8
W Standard Gallery Activity? Android & Cross-Platform Mobile Apps 22
schlingel Android: Overlay in Activity Android & Cross-Platform Mobile Apps 3
G Activity beenden Android & Cross-Platform Mobile Apps 2
T Lesen / Schreiben einer Textdatei - SD-Karte Android & Cross-Platform Mobile Apps 42
OnDemand Allgemeine Fragen zu einer App Android & Cross-Platform Mobile Apps 4
I Foto mit einer bestimmten Auflösung aufnehmen und als Datei ablegen. Android & Cross-Platform Mobile Apps 5
Jose05 Wie kann man mit einer App Geld verdienen? Android & Cross-Platform Mobile Apps 6
T Android Studio: Einen Button in einer For Schleife verwenden Android & Cross-Platform Mobile Apps 2
J Android Zugriff auf eine Datei, diese von einer anderen App erstellt wurde? Android & Cross-Platform Mobile Apps 11
Mo1234 Plattform in einer App. Bitte um Hilfe! Android & Cross-Platform Mobile Apps 8
A Mit Java neues item in ein string-array einer Strings.xml schreiben Android & Cross-Platform Mobile Apps 4
P Android Wie bestimme ich den Dateinamen einer Bilddatei? Android & Cross-Platform Mobile Apps 11
B Falsche ausgabe einer Rechnung! Android & Cross-Platform Mobile Apps 8
M Android Dynamische SchriftGröße einer TextView Android & Cross-Platform Mobile Apps 3
J Android Suche in einer ListView Android & Cross-Platform Mobile Apps 3
G Android Daten in einer Datenbank speichern Android & Cross-Platform Mobile Apps 1
J Android button mithilfe einer Methode automatisch erstellen Android & Cross-Platform Mobile Apps 6
JavaWolf165 Android Fehler beim Speichern/Downloaden einer Datei Android & Cross-Platform Mobile Apps 2
S Android Probleme beim Verbinden mit einer HTTPS Seite Android & Cross-Platform Mobile Apps 4
B Android wie kann ich in einer xml nach bestimme item suchen (DOM) Android & Cross-Platform Mobile Apps 7
C Android Diese Art von Werbung in einer App? Android & Cross-Platform Mobile Apps 1
? ständig ändernden Inhalten in einer App Android & Cross-Platform Mobile Apps 2
R Android Eine Website-frame in einer App Android & Cross-Platform Mobile Apps 4
H Android Aufrufen von "setContentView" in einer anderen Klasse Android & Cross-Platform Mobile Apps 3
S Die Erstellung einer eigenen App,Kosten? Android & Cross-Platform Mobile Apps 1
M Android Speichern einer .txt Datei im InternalStorage Android & Cross-Platform Mobile Apps 2
B Fragen zum Speichern einer Datei auf dem Gerät? Android & Cross-Platform Mobile Apps 7
C Auf Play Store verlinken - Code in einer Extraklasse Android & Cross-Platform Mobile Apps 1
G Thread in einer Service erstellen Android & Cross-Platform Mobile Apps 0
B Android Spieler Steuerung auf einer Map mit Berge? Android & Cross-Platform Mobile Apps 7
M Android Quellcode einer Website Android & Cross-Platform Mobile Apps 7
K Löschen einer Tabelle bei PlayStore update Android & Cross-Platform Mobile Apps 2
H Veröffentlichung einer Bezahl-App Android & Cross-Platform Mobile Apps 5
Robat Android ConcurrentModificationException während einer for Schleife Android & Cross-Platform Mobile Apps 15
D Android EditText und TextView haben unterschiedliche größen innerhalb einer TableRow Android & Cross-Platform Mobile Apps 18
M Umlaute im Quellcode einer Website richtig darstellen Android & Cross-Platform Mobile Apps 4
M Quellcode einer Website auslesen Android & Cross-Platform Mobile Apps 5
T Android platzsparende Codierung verschlüsselter Texte in einer URI Android & Cross-Platform Mobile Apps 8
F Bei einer Android Java App, Objekte erstellen Android & Cross-Platform Mobile Apps 2
G Einbinden einer Bibliothek's App Android & Cross-Platform Mobile Apps 2
A Fehler beim Starten eines Intents - alles in einer Klasse funktioniert... Android & Cross-Platform Mobile Apps 4
A Kann nicht in TextView einer anderen Klasse schreiben - wieso? Android & Cross-Platform Mobile Apps 9
T Android Multiple SDK-Support in einer Apk Android & Cross-Platform Mobile Apps 5
R Android Unterschiedliche Versionen von Android in einer App Android & Cross-Platform Mobile Apps 7
D Mehrere Kopien von einer Form Android & Cross-Platform Mobile Apps 7
M Wie in einer anderen "nicht canvas" klasse zeichne Android & Cross-Platform Mobile Apps 5
S Problem mit Einbindung einer externer Bibliothek Android & Cross-Platform Mobile Apps 2
S Variable Anzahl von Bytes aus einer Datei lesen Android & Cross-Platform Mobile Apps 2
P Erstellen einer Jar-File Android & Cross-Platform Mobile Apps 2
I Android Auf ImageView aus einem anderen Thread zugreifen liefert Fehlermeldung (App stürzt ab) Android & Cross-Platform Mobile Apps 5
F Projekt mit GIT auf anderen Rechner umgezogen Android & Cross-Platform Mobile Apps 2
L Android Marker mit Icons versehen und mit anderen icons clustern lassen Android & Cross-Platform Mobile Apps 0
S Auf Methode zugreifen von anderen Klassen Android & Cross-Platform Mobile Apps 6
A Android Von einem Thread auf anderen zugreifen Android & Cross-Platform Mobile Apps 3

Ähnliche Java Themen

Neue Themen


Oben