Chào mọi người, hiện tại em đang học Android Studio theo chương trình chuẩn của Android. Đến bài này https://developer.android.com/training/sharing/send.html thì khi lập trình để thiết lập create chooser, máy báo lỗi ngay đoạn code send_to mà không thể hiện ra màn hình như trong bài. Vậy phải làm sao ạ?
Code của em phần Java:
package com.example.lenghia.sendapp;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
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)));
}
}