-6

I want to display a text page in android app, which is having description about my app. This text page will be displayed after clicking upon a button. I have several buttons and I want to display various pages for every button. Could you help me ? Thanks in advance.

rahul
  • 410
  • 3
  • 8

1 Answers1

1

First:-

Create one layout in which you show your desired buttons. Set setOnClickListener on Buttons.

Second:-

Create different Layouts for every button click Page results. Like you have 5 buttons then create 5 Layout containing TextViews.

Third:-

set Intent call on every Button. Put this code on every Button click Intent calling method.

Intent intent= new Intent(Firstactivity.this,secondactivity.class);
startActivity(intent);
Goblin シ
  • 90
  • 13
  • thanks for the answer. I created up to this. I struck at secondactivity.class – rahul Oct 14 '16 at 05:49
  • I searching how to create secondactivity.class . to display a bunch of lines. I am new to android. Kindly help me to get out of this issue. – rahul Oct 14 '16 at 05:50
  • For every layout (XML) you have to create a Class(.java), in which you have to declare everything like Layout Containing textView, imageView etc. So that will be your second Activity. – Goblin シ Oct 14 '16 at 05:55
  • This is the simplest example for intent call: http://programmerguru.com/android-tutorial/android-intent-example/ – Goblin シ Oct 14 '16 at 05:59
  • thanks a lot for sharing your knowledge. :) – rahul Oct 14 '16 at 06:05
  • no problem bro. keep it up – Goblin シ Oct 14 '16 at 06:09
  • @rahul try to follow questionnaire structure provided by stackoverflow to get rid of down vote to your question. – Jaccs Oct 14 '16 at 07:40