Improve adding repos from the clipboard
In some cases (e.g. when using Firefox Klar) and copying the URL (of a link), then only the uri is set and not the text. This prevented (before this commit) the autofill of the add package source dialog in such cases.
This commit is contained in:
parent
ada263feca
commit
94e441cc9c
@ -182,6 +182,14 @@ public class ManageReposActivity extends AppCompatActivity
|
||||
ClipData data = clipboardManager.getPrimaryClip();
|
||||
if (data.getItemCount() > 0) {
|
||||
text = data.getItemAt(0).getText();
|
||||
|
||||
if (text == null) {
|
||||
Uri uri = data.getItemAt(0).getUri();
|
||||
|
||||
if (uri != null) {
|
||||
text = uri.toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return text != null ? text.toString() : null;
|
||||
|
Loading…
x
Reference in New Issue
Block a user