aryan99
شنبه 22 شهریور 1393, 16:00 عصر
سلام
من در ListViewAdapter.java دکمه اشتراک متن تعریف کردم ولی قسمت startactivity اصلا کار نمی کنه
لطفا کمکم کنید که باید چه کار کنم ؟
اینم کد :
OnClickListener clickListener = new OnClickListener() {
@Override
public void onClick(View v) {
try{
Context context = v.getContext();
String ab = (String) holder.tvComment.getText();
holder.tvComment.setText(ab);
Toast.makeText(context, ab, Toast.LENGTH_LONG).show();
Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, ab);
sendIntent.setType("text/plain");
context.startActivity(sendIntent);
}
catch (Exception e){
Log.w("Share Data", "Error!");
}
}
};
holder.sharebtn.setOnClickListener(clickListener);
من در ListViewAdapter.java دکمه اشتراک متن تعریف کردم ولی قسمت startactivity اصلا کار نمی کنه
لطفا کمکم کنید که باید چه کار کنم ؟
اینم کد :
OnClickListener clickListener = new OnClickListener() {
@Override
public void onClick(View v) {
try{
Context context = v.getContext();
String ab = (String) holder.tvComment.getText();
holder.tvComment.setText(ab);
Toast.makeText(context, ab, Toast.LENGTH_LONG).show();
Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, ab);
sendIntent.setType("text/plain");
context.startActivity(sendIntent);
}
catch (Exception e){
Log.w("Share Data", "Error!");
}
}
};
holder.sharebtn.setOnClickListener(clickListener);