Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>So i got the same problem and i dont know what is wrong with the activities so i solved the problem by getting the shared text and put it in a bundle to a new intent to do what ever i want with it </p> <p>here is my code </p> <pre><code>public class GetFromShared extends Activity { TextView tex; @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); Intent intent = this.getIntent(); String action = intent.getAction(); String type = intent.getType(); if (Intent.ACTION_SEND.equals(action) &amp;&amp; type != null) { if ("text/plain".equals(type)) { String sharedText = intent.getStringExtra(Intent.EXTRA_TEXT); Log.d("Shared text is", sharedText); Intent rooy = new Intent(getApplicationContext(), BayenELText.class); rooy.putExtra("GotText", sharedText); startActivity(rooy); } } } } </code></pre> <p>and receiving class is </p> <pre><code>public class BayenELText extends Activity { TextView blabla; @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.getsharedtext); blabla = (TextView) findViewById(R.id.etSharedText); Bundle extras = getIntent().getExtras(); String hloho = extras.getString("GotText"); blabla.setText(hloho); } } </code></pre> <p>the log shows the shared text when it called from share via but the thing i thought of that the Intent filter when it called by </p> <pre><code>&lt;action android:name="android.intent.action.SEND" /&gt; </code></pre> <p>doesn't have the permmision to make any changes to the view so that how i solve it and it works fine ;)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload