How can I overlay the back and next buttons in the select Wi-Fi network window?

Google play does this when you try to use it and do not connect to a Wi-Fi network.

photo of what I'm trying to do:

image

If you just run the standard

startActivity(new Intent(WifiManager.ACTION_PICK_WIFI_NETWORK));

Then it loads the window I'm looking for. However, I want the back and next buttons to be added on top of it. It should go back to the previous window, and the next should be selected only if a network was selected and authentication was performed (if necessary). Then he will move on to another action.

I tried to implement it with fragments (one for launching a running window and another for a button), but it does not work.

This was the code that ran when the application executed

public class TestActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.layfile);
//        Intent n = new Intent(this,Pactivity.class);
//        startActivity(n);
//        
    }
}

public class Pactivity extends PreferenceActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    addPreferencesFromResource(R.xml.preferences);
    //addPreferencesFromIntent(new Intent(WifiManager.ACTION_PICK_WIFI_NETWORK));
    setContentView(R.layout.main);

}

}

public class Pfrag extends PreferenceFragment {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // Load the preferences from an XML resource
        addPreferencesFromResource(R.xml.preferences);
    }
}

Here are the xml files

<?xml version="1.0" encoding="UTF-8"?>

<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" >    
    <Preference 
        android:key="key"   
        android:title="WiFi" 
        android:summary="Calls WiFi">           
            <intent android:action="android.net.wifi.PICK_WIFI_NETWORK"/>           
    </Preference>
</PreferenceScreen>

, . , .

, , WifiManager.ACTION_PICK_WIFI_NETWORK?

+5
2
    Intent intent = new Intent(WifiManager.ACTION_PICK_WIFI_NETWORK);       
    intent.putExtra("only_access_points", true);
    intent.putExtra("extra_prefs_show_button_bar", true);
    intent.putExtra("wifi_enable_next_on_connect", true);
    startActivityForResult(intent, 1);

. Google.

+15

UncleKing.

, , WifiManager.ACTION_PICK_WIFI_NETWORK?

only_access_points wifi_enable_next_on_connect. extra_prefs_show_button_bar. .

ADB, :

am start -a android.net.wifi.PICK_WIFI_NETWORK --ez extra_prefs_show_button_bar True

, :

Intent intent = new Intent(WifiManager.ACTION_PICK_WIFI_NETWORK);       
intent.putExtra("extra_prefs_show_button_bar", true);
startActivityForResult(intent, 1);

Android 4.1, 4.4 5.1.

+2

All Articles