diff --git a/src/AndroidManifest.xml b/src/AndroidManifest.xml index 2a6122f..c7fa795 100644 --- a/src/AndroidManifest.xml +++ b/src/AndroidManifest.xml @@ -25,9 +25,13 @@ + + + + + - diff --git a/src/java/com/sharkbyte/qrcodegenerator/MainActivity.java b/src/java/com/sharkbyte/qrcodegenerator/MainActivity.java index 7be28ff..f840583 100644 --- a/src/java/com/sharkbyte/qrcodegenerator/MainActivity.java +++ b/src/java/com/sharkbyte/qrcodegenerator/MainActivity.java @@ -58,7 +58,6 @@ public void errb(String message, String title){ @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - binding = ActivityMainBinding.inflate(getLayoutInflater()); setContentView(binding.getRoot()); @@ -145,6 +144,20 @@ public void onClick(View view) { closeKeyboard(); } }); + + /* SHARE */ + Intent intent = getIntent(); + String action = intent.getAction(); + String type = intent.getType(); + if (Intent.ACTION_SEND.equals(action) && type != null) { + if ("text/plain".equals(type)) { + String sharedText = intent.getStringExtra(Intent.EXTRA_TEXT); + if (sharedText != null) { + binding.textArea.setText(sharedText); + } + + } + } qrupdate(); }