Joel Justin
Joel Justin

Reputation: 1

Error:(21, 87) error: cannot find symbol variable send_to

I was working on my android project and suddenly this error came into my program what could be the reason and how can i clear it... here is my code:

public class sharing extends Activity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_sharing);
    Intent sendIntent = new Intent();
    sendIntent.setAction(Intent.ACTION_SEND);
    sendIntent.putExtra(Intent.EXTRA_TEXT, "This is my text to send.");
    sendIntent.setType("text/plain");
    startActivity(Intent.createChooser(sendIntent, getResources().getText(R.string.send_to)));

}

Upvotes: 0

Views: 87

Answers (1)

Irina Avram
Irina Avram

Reputation: 1522

Try to add this to your string.xml:

<string name="send_to">Sending to</string>

Upvotes: 1

Related Questions