Method for dynamically generating and calling pages in Android non XML form
•
Android
This paper describes the method of dynamically generating and calling pages in Android non XML form. Share with you for your reference. The specific analysis is as follows:
The problem is this: instead of using XML to build pages, we use programs to build new pages and add various controls to the pages.
1、 To build a new page:
① Add a class named signpage in the SRC directory ② add an activity in androidmainfest.xml:
Note that the addition of this sentence indicates that the signpage page is a sub page for the main page to call and start.
③ Open sighpage.java, add an EditText to it, and modify the location:
④ Add a button in the main page. The button event is as follows:
I hope this article will be helpful to your Android program design.
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码