1

Android 携帯電話にアラートを表示する必要があります。私はasp.net(c#)で作業しており、使用する場合:

protected void CheckNumber(object sender, EventArgs e)
{
    ...
    if (Convert.ToInt64(TextBox.Text) <= 0)
    {
         Response.Write("<script>alert('The number must be positive')</script>");
         return;
    }
    ...
}

上に開くメッセージや画面はありません。

私も違いなしでこれを試しました:

if (Convert.ToInt64(TextBox.Text) <= 0)
{
      MessageBox.Show("The number must be positive!");
      return;
}
...

モバイル画面にメッセージと確認ボタンを表示するにはどうすればよいですか?

4

1 に答える 1

2

Toasts http://developer.android.com/guide/topics/ui/notifiers/toasts.htmlを使用してみてください。

またはAlertDialog http://mobile.tutsplus.com/tutorials/android/android-sdk-alert/を使用します

于 2013-04-11T11:24:36.140 に答える