Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Androidアプリでは、ABCとDの4つのアクティビティが含まれていますが、BとCを介して2つの方法でDアクティビティに移動できます。Dアクティビティにいる間、BまたはCから来たアクティビティを識別する方法は?
いいえ、申し訳ありません。組み込みのメカニズムはありません。インテントのエクストラでブール値を設定して、呼び出し元のアクティビティを確認できます。
これを試して
Intent intent = getIntent(); intent.getComponent().getClassName());
それが役立つかどうかを確認してください