how to Open new screen in Android?

落爺英雄遲暮 提交于 2019-12-21 09:15:00

问题


i am new to android and i have created a login page after verifing login

i get results true or false on the bases of user authentication now my goal is to show another screen on successful authentication with some new textboxes and button i mean new layout how to achieve this???

any help would be appriciated.


回答1:


You want to start new activity. You can read more on initiating new Activities at Android documentation.

However you might consider making a "normal" application screen and call another Activity for login purposes instead of having a login page and redirection.

So if page/Activity_A requires user to be logged in, you call LoginActivity with startActivityForResult and get true/false if user has properly logged in.




回答2:


http://www.warriorpoint.com/blog/2009/05/24/android-how-to-switch-between-activities/




回答3:


create an Intent and pass the intent to startactivty method. ake sure your activity should be defined in manifest file




回答4:


Read about Intents

intents are used to start new activity

Activity is the super class that represents each of your view corresponding to your layout

in Professional Android App Dev- WROX by Retro Meier gives good examples for this in a chapter for Intents and Broadcast.



来源:https://stackoverflow.com/questions/2085443/how-to-open-new-screen-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!