Hi Lars,
you can do somthing like this, its not the same but good enough:
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setCancelable(true);
builder.setMessage(R.string.no_connection);
builder.setTitle(R.string.no_connection_title);
builder.setPositiveButton(R.string.settings_button_text, new
DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
startActivity(new
Intent(Settings.ACTION_WIRELESS_SETTINGS));
}
});
builder.setNegativeButton(R.string.cancel_button_text, new
DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
Toast.makeText(MyAudioTrack.this, "cancel
pressed",
Toast.LENGTH_SHORT).show();
return;
}
});
builder.setOnCancelListener(new
DialogInterface.OnCancelListener() {
public void onCancel(DialogInterface dialog) {
Toast.makeText(MyAudioTrack.this, "Back pressed",
Toast.LENGTH_SHORT).show();
return;
}});
builder.show();
And to your strings.xml:
<resources>
<string name="no_connection_title">Connection failed</string>
<string name="no_connection">This application requires network
access. Enable mobile network or Wi-Fi to download data.</string>
<string name="settings_button_text">Settings</string>
<string name="cancel_button_text">Cancel</string>
</resources>
Greets Klaus
On Oct 18, 9:10 pm, Lars Carlsson <[email protected]> wrote:
> Hi
> How do i create a message box that saysConnection failed"this
> application requires network access to work" and in the message box
> you click Settings or canceled. The same message box you get when you
> try to use the browser with no Internet connection. I have looked in
> the Browser code but could not figure out how the make a button that
> take you to the phone setting window.
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en