提交表单后如何显示提醒信息

时间:2015-09-18 05:31:41

标签: php

我想显示所选语言的提示信息。提交表格后显示警告消息。显示代码。我想显示之后选择语言的提示信息。我该怎么办?

@Override
protected void onCreate(Bundle savedInstanceState) {
    ...
    addContactButton = (Button) findViewById(R.id.addContactButton);
    addContactButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Intent intent = new Intent(Intent.ACTION_PICK, ContactsContract.Contacts.CONTENT_URI);
            startActivityForResult(intent, PICK_CONTACT);
        }
    });
}

@Override
public void onActivityResult(int reqCode, int resultCode, Intent data) {
    Log.d(TAG, "onActivityResult");
    super.onActivityResult(reqCode, resultCode, data);

    switch (reqCode) {
        case (PICK_CONTACT) :
            if (resultCode == Activity.RESULT_OK) {
                Uri contactData = data.getData();
                Cursor c =  getContentResolver().query(contactData, null, null, null, null);
                if (c.moveToFirst()) {
                    String name = c.getString(c.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME));
                    // TODO Whatever you want to do with the selected contact name.
                    Log.d(TAG, "you chose " + name + ".");
                }
            }
            break;
    }
}

1 个答案:

答案 0 :(得分:1)

放置以下代码

echo '<script>
alert("You have selected '.$language.'");
window.location = "'.$SITE_URL.'index.php?view=view_service."
</script>';
//header("location:".SITE_URL."index.php?view=view_service");