简体   繁体   中英

Attempting to use Intent, to launch a new app and have the launching application automatically log in using new apps login credentials

I have an application that is currently set to launch another application, this new application requires login information to be entered before you can go any further in the application. The required login credentials are saved in the newly launched applications .java files. I want the original application to pull the login data from the new app (or just update the text fields with the data) and automatically log in without the user having to adjust any settings.

I'm new to Android development and very rusty on basic Java, I'm trying to learn and the best way I can is to look at some code that will do this or an explanation on what is required to complete a task such as this.

Any help is appreciated!

When activity1 launches activity2, use startActvityForResult(intent) instead of startActivity(intent). When activity2 has the requested credentials, bundle them and return to activity1 (override the method onActivityResult() to handle the results).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM