Open web search in a new window
This commit is contained in:
parent
9e306b3f91
commit
5283a0ca7a
2 changed files with 6 additions and 7 deletions
|
|
@ -221,14 +221,16 @@ public abstract class AbsTagEditorActivity extends AbsBaseActivity {
|
||||||
@NonNull
|
@NonNull
|
||||||
protected abstract List<String> getSongPaths();
|
protected abstract List<String> getSongPaths();
|
||||||
|
|
||||||
protected void searchWebFor(@NonNull List<String> strings) {
|
protected void searchWebFor(String... keys) {
|
||||||
StringBuilder stringBuilder = new StringBuilder();
|
StringBuilder stringBuilder = new StringBuilder();
|
||||||
for (String string : strings) {
|
for (String key : keys) {
|
||||||
stringBuilder.append(string);
|
stringBuilder.append(key);
|
||||||
stringBuilder.append(" ");
|
stringBuilder.append(" ");
|
||||||
}
|
}
|
||||||
Intent intent = new Intent(Intent.ACTION_WEB_SEARCH);
|
Intent intent = new Intent(Intent.ACTION_WEB_SEARCH);
|
||||||
intent.putExtra(SearchManager.QUERY, stringBuilder.toString());
|
intent.putExtra(SearchManager.QUERY, stringBuilder.toString());
|
||||||
|
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
|
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -153,10 +153,7 @@ public class AlbumTagEditorActivity extends AbsTagEditorActivity implements Text
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void searchImageOnWeb() {
|
protected void searchImageOnWeb() {
|
||||||
List<String> query = new ArrayList<>();
|
searchWebFor(albumTitle.getText().toString(), albumArtist.getText().toString());
|
||||||
query.add(albumTitle.getText().toString());
|
|
||||||
query.add(albumArtist.getText().toString());
|
|
||||||
searchWebFor(query);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue