mirror of
https://codeberg.org/tom79/Fedilab.git
synced 2024-12-23 09:10:04 +02:00
Fix issue #276 - Search OG when there is only one URL
This commit is contained in:
parent
74921e6d16
commit
18bc812cf1
1 changed files with 5 additions and 2 deletions
|
@ -302,13 +302,16 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
|
|||
*/
|
||||
Matcher matcher;
|
||||
matcher = Patterns.WEB_URL.matcher(sharedText);
|
||||
int count = 0;
|
||||
while (matcher.find()) {
|
||||
int matchStart = matcher.start(1);
|
||||
int matchEnd = matcher.end();
|
||||
if (matchStart < matchEnd && sharedText.length() >= matchEnd)
|
||||
if (matchStart < matchEnd && sharedText.length() >= matchEnd) {
|
||||
url[0] = sharedText.substring(matchStart, matchEnd);
|
||||
count++;
|
||||
}
|
||||
if (url[0] != null && url[0].length() == sharedText.length()) {
|
||||
}
|
||||
if (url[0] != null && count == 1) {
|
||||
new Thread(() -> {
|
||||
if (url[0].startsWith("www."))
|
||||
url[0] = "http://" + url[0];
|
||||
|
|
Loading…
Reference in a new issue