Wednesday 15 June 2011

android - App not showing up in share menu -


I have my app set to achieve shared objectives with the intent filters and handlers. I'm not seeing it in the Share menu

   & Lt; Category android: name = "android.intent.category.DEFAULT" /> & Lt; Data Android: scheme = "http" /> & Lt; / Intent-Filter & gt; & Lt; Intent-Filter & gt; & Lt; Action Android: name = "android.intent.action.SEND" /> & Lt; Category android: name = "android.intent.category.DEFAULT" /> & Lt; Data Android: scheme = "https" /> & Lt; / Intent-Filter & gt; Intent = getIntent (); String action = intent. Gate action (); String type = intent.getType (); If (Intent.ACTION_SEND.equals (Action) & amp; & amp; type.equals ( "text / plain")) {AlertDialog.Builder builder = new AlertDialog.Builder (MainActivity.this); Builder.setTitle (R.string.pick_profile); builder.setItems (getConnProfNames (connectionProfiles), New DialogInterface.OnClickListener () {public void onClick (DialogInterface dialog, int which) {SelectedItem = connectionProfiles.get (a); DownloadTask.execute ();}}); }    

There is no such thing as a side effect. Apps can share data using different functions, types, extras and data with the intents. Most of these applications will use ACTION_SEND but depending on the app, other parameters will vary widely with your intent-filter, you capture intents using only HTTP and other HTTP schemes, and your code text / plain of additional type Restricts. It all depends what the "share menu", when does the works start up or not over your code.

Does using Dolphin browser aims to share not enter your data AFAIK public or not. I have been successful in "catching" an intent by using the following filter:

  & lt; Intent-filter & gt; & Lt; Action Android: name = "android.intent.action.SEND" /> & Lt; Data Android: mimeType = "* / *" /> & Lt; Category android: name = "android.intent.category.DEFAULT" /> & Lt; / Intent-Filter & gt;   

I have also received the URL from the extras such as:

  CharSequence text = intent.getCharSequenceExtra (Intent.EXTRA_TEXT);   

It really depends on what you are trying to to get her needs filters. If you are trying to capture the URL and load the HTML page, then the filter I use will work. This allows you to get the URL and then you can show the page eg In a WebView.

No comments:

Post a Comment