11 package com.freerdp.freerdpcore.services;
13 import android.app.Activity;
14 import android.app.SearchManager;
15 import android.content.Intent;
16 import android.os.Bundle;
17 import androidx.appcompat.app.AppCompatActivity;
19 import com.freerdp.freerdpcore.domain.ConnectionReference;
20 import com.freerdp.freerdpcore.presentation.BookmarkActivity;
21 import com.freerdp.freerdpcore.presentation.SessionActivity;
26 @Override
public void onCreate(Bundle savedInstanceState)
28 super.onCreate(savedInstanceState);
29 handleIntent(getIntent());
32 @Override
protected void onNewIntent(Intent intent)
38 private void startSessionWithConnectionReference(String refStr)
41 Bundle bundle =
new Bundle();
44 sessionIntent.putExtras(bundle);
46 startActivityForResult(sessionIntent, 0);
49 private void editBookmarkWithConnectionReference(String refStr)
51 Bundle bundle =
new Bundle();
53 Intent bookmarkIntent =
new Intent(this.getApplicationContext(),
BookmarkActivity.class);
54 bookmarkIntent.putExtras(bundle);
55 startActivityForResult(bookmarkIntent, 0);
58 private void handleIntent(Intent intent)
61 String action = intent.getAction();
62 if (Intent.ACTION_SEARCH.equals(action))
64 intent.getStringExtra(SearchManager.QUERY)));
65 else if (Intent.ACTION_VIEW.equals(action))
66 startSessionWithConnectionReference(intent.getDataString());
67 else if (Intent.ACTION_EDIT.equals(action))
68 editBookmarkWithConnectionReference(intent.getDataString());
71 @Override
protected void onActivityResult(
int requestCode,
int resultCode, Intent data)
73 super.onActivityResult(requestCode, resultCode, data);
74 this.setResult(resultCode);