Search code examples
androidhotspottethering

How to open Hotspot & tethering setting screen and after that open security popup screen programmatically?


Here I want to just open Hotspot & tethering screen from button click, so user can create Hotspot manually. I have searched a lot but no any implicit intent found for go that screen. Also Can I open popup in which user can write Network name and security details ? If yes, so how ?


Solution

  • This should work:

    final Intent intent = new Intent(Intent.ACTION_MAIN, null);
    intent.addCategory(Intent.CATEGORY_LAUNCHER);
    final ComponentName cn = new ComponentName("com.android.settings", "com.android.settings.TetherSettings");
    intent.setComponent(cn);
    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    startActivity(intent);
    

    However it may dependent on the actual device, Samsung, LG, Sony might be different.