I\'m trying to make an app in Android Studio which requires you to download a file to the sdcard/Download/ folder on the users device. The problem is that when I enter the URL t
Since you said it's in AndroidFileDownload, I'd suggest you to do as follows:
@Override
public void onClick(View view)
// you need to get the id of the clicked view:
if(view.getId() == R.id.download_button) {
EditText urlInputField = (EditText) thisActivity.findViewById(R.id.url_input);
String urlInput = urlInputField.getText().toString();
downloaderThread = new DownloaderThread(thisActivity, urlInput);
downloaderThread.start();
}
}
This is the cause of: NoSuchMethodException: onClick [class android.view.View]. It means that your onClick method cannot find your button (id) where you did set an onClickListener method.
And then, in the future, I think the problem will be that AndroidFileDownload is not declared in your Manifest file. You should add it as follows:
// add every activity in your app like this below