Adapter 관련

<adapter에서 activity호출하는 방법>

앞에 mContext.startActivity 해주면 된다

adapter에 bt_seeMore.setOnClickListener를 등록해주면 listview의 custom layout 버튼에 이벤트를 줄 수 있다.

예제)

tv_oneSentence.setOnClickListener(new OnClickListener()
{
   @Override
   public void onClick(View v) {
      // TODO Auto-generated method stub
      Intent intent = new Intent(mContext, MainActivity.class);
      intent.putExtra("date",bt_dateinfo.getText()); //intent의 date값으로 YYYY-MM-DD를 전달한다.
      mContext.startActivity(intent);
   }
});

 

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s