Merge pull request #69 from PhotonQyv/FixMalformedURLException_SharingIntent
Added a fix for a url that arrives sans 'http://'.
This commit is contained in:
commit
b0060ec145
|
@ -392,6 +392,8 @@ public class TootActivity extends AppCompatActivity implements OnRetrieveSearcAc
|
|||
String title = intent.getStringExtra("title");
|
||||
String description = intent.getStringExtra("description");
|
||||
if( description != null && description.length() > 0){
|
||||
if (sharedContentIni.startsWith("www."))
|
||||
sharedContentIni = "http://" + sharedContentIni;
|
||||
if( title != null && title.length() > 0)
|
||||
sharedContent = title + "\n\n" + description + "\n\n" + sharedContentIni;
|
||||
else
|
||||
|
|
|
@ -51,6 +51,10 @@ public class RetrieveMetaDataAsyncTask extends AsyncTask<Void, Void, Void> {
|
|||
String potentialUrl = "";
|
||||
try {
|
||||
Matcher matcher;
|
||||
|
||||
if (url.startsWith("www."))
|
||||
url = "http://" + url;
|
||||
|
||||
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.KITKAT)
|
||||
matcher = Patterns.WEB_URL.matcher(url);
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue