0

i wanna show the details data from listviews android, i did it... but the problem is, i don't know how to make a function to show the next/previous detail data by clicking the next/previous button based on listview data.

this is my listview data layout

and this is my next/previous layout for details data

please someone, tell me how to do this (sample code, tutorial, link)

thank in advance

Toto
  • 89,455
  • 62
  • 89
  • 125
Arsyah
  • 79
  • 3
  • 11

2 Answers2

0

Damn it! Play with your array-list data of listview, pass appropriate position to next activity and while press next call next data from array-list, same while pressing previous call previous data from array list, this way you can achieve your goal!

I answered one of similar question hope it will help you.

stackverflow question:How to do next button action?

Community
  • 1
  • 1
RobinHood
  • 10,897
  • 4
  • 48
  • 97
  • hi @Robinhood....i'm still confused about next/previous details data listview....please check [my related question](http://stackoverflow.com/questions/15376995/getting-next-and-previous-detail-data-from-listview) hope you can help my problem...:) Thank – Arsyah Mar 13 '13 at 07:51
0
  1. By using get and set method my making a function in different class where activity name is stored. You can set every prev or next activity and call it by get method.

  2. By calling intent.

Eg:

 `    public void onClick(View arg0) {
                // TODO Auto-generated method stub
                Intent_start1();
                finish();
            }

            private void Intent_start1() {
                // TODO Auto-generated method stub
                Intent i2 = new Intent();
                i2.setClass([Your Current Class].this,[Class where you wish to move].class);
                startActivity(i2);
            }
        }); `

Dont call finish() method

I like to use intent :)

Shachi
  • 1,858
  • 3
  • 23
  • 41
  • everytime have to call intent, if once it called and now when pressing next, have to call intent again? – RobinHood Feb 26 '13 at 07:28
  • If in same class, You can always call intent again. Even getset method works well. – Shachi Feb 26 '13 at 07:32
  • seem you not understand the OP question properly. "Once the intent call and next activity start and on next activity there is next button when it click so next data should be display same in the case of previous button but it will display previous data" – RobinHood Feb 26 '13 at 07:35
  • 1
    ya..u r right.. for that getset method function should be used..rit?? @Robinhood – Shachi Feb 26 '13 at 07:41
  • Thank b4 for the answer Mr.Shachi, but i think Mr.Robinhood's answer more closely to what i'm looking for...:) – Arsyah Feb 26 '13 at 07:44