嗨,在我的应用程序中,我有一个带有列表视图和微调器的片段,我正在使用 cursoradapter 将数据从我的数据库中获取到列表视图中,我想通过电子邮件共享此列表视图数据,我正在我的操作栏上实现 shareintent 操作,但被击中如何将列表视图数据获取到意图选择器中。
下面是我的代码:
actionBar.addAction(new IntentAction(this, createShareIntent(), R.drawable.ic_title_share_default));
private Intent createShareIntent() {
final Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_TEXT, "Shared from the ActionBar widget.");
return Intent.createChooser(intent, "Share");
}
下面是我的 cursorAdapter
public class bottomlistmonthlyvolume extends CursorAdapter {
LayoutInflater inflater;
public bottomlistmonthlyvolume(Context context, Cursor c) {
super(context, c);
inflater = LayoutInflater.from(context);
}
@Override
public void bindView(View view, Context context, Cursor topcursor) {
// TODO Auto-generated method stub
TextView tv1 = (TextView)view.findViewById(R.id.textView123);
TextView tv2 = (TextView)view.findViewById(R.id.achievmentValue);
TextView tv3 = (TextView)view.findViewById(R.id.shortfallValue);
TextView et1 = (TextView)view.findViewById(R.id.actualvalue);
TextView et2 = (TextView)view.findViewById(R.id.budgetvalue);
tv1.setText(topcursor.getString(1));
tv2.setText(topcursor.getString(7));
tv3.setText(topcursor.getString(9));
et1.setText(topcursor.getString(3));
et2.setText(topcursor.getString(5));
}
@Override
public View newView(Context context, Cursor cursor, ViewGroup parent) {
return inflater.inflate(R.layout.word_list_item, parent, false);
}
}
有人可以建议如何实现它