Renamed the callback handler.
This commit is contained in:
parent
5b230f5b6a
commit
bac9149865
@ -30,7 +30,7 @@ public class MainActivity extends Activity {
|
||||
String sharedText = intent.getStringExtra(Intent.EXTRA_TEXT);
|
||||
Log.d("Share With Title", "Received shared text: " + sharedText);
|
||||
|
||||
new TitleRetriever(sharedText).retrieve(new TitleViewUpdater() {
|
||||
new TitleRetriever(sharedText).retrieve(new TitleGrabCallback() {
|
||||
@Override
|
||||
public void update(String title) {
|
||||
textView.setText(title);
|
||||
|
@ -3,7 +3,7 @@ package in.sdqali.sharewithtitle;
|
||||
/**
|
||||
* Created by sdqali on 7/20/13.
|
||||
*/
|
||||
public interface TitleViewUpdater {
|
||||
public interface TitleGrabCallback {
|
||||
public void update(String title);
|
||||
public void showProgress();
|
||||
public void finish();
|
@ -1,11 +1,8 @@
|
||||
package in.sdqali.sharewithtitle;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.AsyncTask;
|
||||
import android.util.Log;
|
||||
import android.webkit.URLUtil;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
@ -20,7 +17,7 @@ public class TitleRetriever {
|
||||
this.urlText = url;
|
||||
}
|
||||
|
||||
public void retrieve(TitleViewUpdater viewUpdater) {
|
||||
public void retrieve(TitleGrabCallback viewUpdater) {
|
||||
if(isValidUrl(urlText)) {
|
||||
new DownloadTaskNew(viewUpdater).execute(urlText);
|
||||
} else {
|
||||
@ -33,10 +30,10 @@ public class TitleRetriever {
|
||||
}
|
||||
|
||||
private class DownloadTaskNew extends AsyncTask<String, Void, String> {
|
||||
private TitleViewUpdater viewUpdater;
|
||||
private TitleGrabCallback viewUpdater;
|
||||
private final PageDownloader pageDownloader = new PageDownloader();
|
||||
|
||||
public DownloadTaskNew(TitleViewUpdater viewUpdater) {
|
||||
public DownloadTaskNew(TitleGrabCallback viewUpdater) {
|
||||
this.viewUpdater = viewUpdater;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user