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 title = intent.getStringExtra("title");
|
||||||
String description = intent.getStringExtra("description");
|
String description = intent.getStringExtra("description");
|
||||||
if( description != null && description.length() > 0){
|
if( description != null && description.length() > 0){
|
||||||
|
if (sharedContentIni.startsWith("www."))
|
||||||
|
sharedContentIni = "http://" + sharedContentIni;
|
||||||
if( title != null && title.length() > 0)
|
if( title != null && title.length() > 0)
|
||||||
sharedContent = title + "\n\n" + description + "\n\n" + sharedContentIni;
|
sharedContent = title + "\n\n" + description + "\n\n" + sharedContentIni;
|
||||||
else
|
else
|
||||||
|
|
|
@ -51,6 +51,10 @@ public class RetrieveMetaDataAsyncTask extends AsyncTask<Void, Void, Void> {
|
||||||
String potentialUrl = "";
|
String potentialUrl = "";
|
||||||
try {
|
try {
|
||||||
Matcher matcher;
|
Matcher matcher;
|
||||||
|
|
||||||
|
if (url.startsWith("www."))
|
||||||
|
url = "http://" + url;
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.KITKAT)
|
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.KITKAT)
|
||||||
matcher = Patterns.WEB_URL.matcher(url);
|
matcher = Patterns.WEB_URL.matcher(url);
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue