Open web search in a new window

This commit is contained in:
Karim Abou Zeid 2015-08-26 16:47:25 +02:00
commit 5283a0ca7a
2 changed files with 6 additions and 7 deletions

View file

@ -221,14 +221,16 @@ public abstract class AbsTagEditorActivity extends AbsBaseActivity {
@NonNull
protected abstract List<String> getSongPaths();
protected void searchWebFor(@NonNull List<String> strings) {
protected void searchWebFor(String... keys) {
StringBuilder stringBuilder = new StringBuilder();
for (String string : strings) {
stringBuilder.append(string);
for (String key : keys) {
stringBuilder.append(key);
stringBuilder.append(" ");
}
Intent intent = new Intent(Intent.ACTION_WEB_SEARCH);
intent.putExtra(SearchManager.QUERY, stringBuilder.toString());
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
}

View file

@ -153,10 +153,7 @@ public class AlbumTagEditorActivity extends AbsTagEditorActivity implements Text
@Override
protected void searchImageOnWeb() {
List<String> query = new ArrayList<>();
query.add(albumTitle.getText().toString());
query.add(albumArtist.getText().toString());
searchWebFor(query);
searchWebFor(albumTitle.getText().toString(), albumArtist.getText().toString());
}
@Override