Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid: how to share listview data using Intent.createChooser()
    text
    copied!<p>Hi in my app i have a fragment with listview and a spinner, i am getting the data into the listview from my database using the cursoradapter, i wanna share this listview data via email , i am implementing the shareintent action on my actionbar , but struck how to get the listview data into the intent chooser.</p> <p>Below is my code:</p> <pre><code> 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"); } </code></pre> <p>Below is my cursorAdapter </p> <pre><code>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); } } </code></pre> <p>can someone suggest how to implement it</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload