Listactivity With Multiple button and multiple videos

后端 未结 3 545
予麋鹿
予麋鹿 2021-01-26 18:12

i have a listactivity app , consist of 5 rows , each row cotain one TEXT and 5 BUTTON , both text and buttons are clickable , text will open MyDay activity whic is textview and

3条回答
  •  深忆病人
    2021-01-26 18:39

    You have 5 buttons, 25 links, 5 rows, And if u set 5 listener(for each button 1) u can select the uri like this ex:

    button1,button2,button3,button4,button5;
    
    button1.setOnclickListener(new View.onClickListener{
        public void onClick(View v){
            Integer pos = (Integer) v.getTag();
            Intent ourIntent = new Intent(mContext, MyDay.class);
            ourIntent.putExtra("cheese", mClasses[rowPosition*5+buttonPostion]);
            mContext.startActivity(ourIntent);
        }
    });
    

    rowPosition=in getView(position) is simple curent convertView number, button position is your your v.getTag() button number now is 1.

    Sow whit this u can select 25 link : exemple when u get onclick in your 2 row, 3rd button the link id will be 2*5+3=13 . so in your secund row the 3 buttom will get the 13 link to play.

提交回复
热议问题