文件中重命名错误eclipse java
嘿,我的android应用程序有问题。我试图从给定的url下载文本到可编辑框,但当我运行应用程序并按下按钮时,它停止工作。 我检查了多次,发现jsoup有问题。该设备已连接到internet。 这是密码文件中重命名错误eclipse java,java,android,jsoup,Java,Android,Jsoup,嘿,我的android应用程序有问题。我试图从给定的url下载文本到可编辑框,但当我运行应用程序并按下按钮时,它停止工作。 我检查了多次,发现jsoup有问题。该设备已连接到internet。 这是密码 public void sendMessage(View view) throws IOException { EditText tf = (EditText) findViewById(R.id.editText1); String kupa = tf.getText().to
public void sendMessage(View view) throws IOException {
EditText tf = (EditText) findViewById(R.id.editText1);
String kupa = tf.getText().toString();
Document doc = Jsoup.connect(kupa).get();
String title = doc.text();
TextView tv = (TextView) findViewById(R.id.textView1);
tv.setText(title);
}
干杯伙计们将此添加到您的onCreate()中:
使用上述方法作为临时解决方案。否则,请使用线程或异步任务
定义异步任务,如下所示:
new DownloadTask().execute();
按如下方式调用任务:
new DownloadTask().execute();
new DownloadTask().execute();