Unable to launch "Wireless Display devices" list screen in Samsung 4.2 and higher phones

StackOverflow https://stackoverflow.com/questions/23416188

  •  13-07-2023
  •  | 
  •  

Pergunta

I have been working on an app that needs to launch the "Wireless Display" devices list screen in android 4.2+ devices and then i found an answer here.

Based on the answer, i used the intent with suggested action "android.settings.WIFI_DISPLAY_SETTINGS" and fired the intent like this:

try
{
    Intent intent = new Intent(ACTION_WIFI_DISPLAY_SETTINGS);
    //intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
    startActivity(intent);

} catch (ActivityNotFoundException e)
{
    e.printStackTrace();
    DialogUtils.showSimpleDialog(HomeActivity.this,"Sorry, Feature not available in your device, please upgrade to android 4.2+");
} 

which is working great for most of the phones but Samsung.

In Samsung 4.2 and higher devices it throws "No such Activity found to handle the intent" error. It looks like Samsung has its own wrapper over the default android SDK and they have changed the handling of this function, not sure how to find out what they have with it.

Any help regarding this is highly appreciated.

Foi útil?

Solução

I think I have found the solution, just need to add below permission and it works:

<uses-permission android:name="com.android.setting.permission.ALLSHARE_CAST_SERVICE" />
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top