Qml App: better Android interaction on URL export

Clipboard usage is uncommon in Android so export the URL via Intent too
that is the common pattern on Android
This commit is contained in:
Gioacchino Mazzurco 2017-07-04 16:27:12 +02:00
parent a97ba803d8
commit dafaa568b8
10 changed files with 205 additions and 9 deletions

View file

@ -65,6 +65,17 @@ public class RetroShareQmlActivity extends QtActivity
if (uri != null) NativeCalls.notifyIntentUri(uri);
}
@UsedByNativeCode @SuppressWarnings("unused")
public void shareUrl(String urlStr)
{
Intent shareIntent = new Intent()
.setAction(Intent.ACTION_SEND)
.putExtra(Intent.EXTRA_TEXT, urlStr)
.setType("text/plain");
startActivity(Intent.createChooser(shareIntent,"")); // TODO: Need proper title?
}
private boolean isMyServiceRunning(Class<?> serviceClass)
{
ActivityManager manager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);