Basically when I execute my app it either crashes, or does not display any text or anything. I am using fragments and viewPager in my main activity but the class that is causing the problems is this one:
public class DailyWord extends Fragment {
Document doc;
String data;
TextView t;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle saveInstanceState) {
    View mainView = inflater.inflate(R.layout.activity_daily_word, container, false);
    try {
        doc = Jsoup.connect("http://www.urbandictionary.com/").get();
    } catch (IOException e) {
        e.printStackTrace();
    }
    Element Worddata = doc.getElementsByClass("word").first();
    Element Worddata2 = Worddata.select("a[href]").first();
    String wordName = Worddata2.text();
    Element definition = doc.getElementsByClass("description").first();
    String define = definition.text();
    Element example = doc.getElementsByClass("example").first();
    String context = example.text();
    data = ("Word:\n" + wordName + "\n" + "Definition\n" + define + "\n" + "Context:\n" + context);
    t = (TextView) mainView.findViewById(R.id.textView1);
    t.setText(data);
        return mainView;
    }
}
 
    