开发者

android: how to create multiply views screen?

I want to create an activity, which shows a question with 4 answers, and at the bottom of the screen i want to place a timer.

I have already found timer example, and i created a question with the answers. the problem that they are 2 different projects and activities, and i am l开发者_如何学Cooking for the best way to implement it. i think i can't show 2 activities on one screen, but i can show 2 views or shell i use the ViewGroup, or maybe to copy-paste one of the activities code to another ( its the easiest way but probably the most ugliest way to implement it). please tell me what is the best way, that i will study and not to waste time to study all the ways and only then to choose one of them.


welcome to StackOverflow.

You are correct in that you cannot display two activities at once. You must instead look into how layouts work in Android by reading some tutorials on the Android developer guide.

For your layout, I would recommend using a LinearLayout with four TextView objects inside it containing the questions (and perhaps your EditText objects below them) as well as your timer. Make sure they are all inside a ScrollView so the software keyboard doesn't force it all to be squeezed up. This is how I would approach it, but I encourage you to read about how layouts work and use the XML resources.

The Notepad tutorial is an excellent way to get started with views and text entry, as well as using SQLite databases.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜