小编DoY*_*ift的帖子

OnBackPressed没有被调用?

我已经覆盖了OnBackPressed我的活动中的函数,但它没有被调用.在其他活动上它工作正常.这是我的方法:

@Override
public void onBackPressed() {
    Log.e("back",""+1); 
    UserPage.getstate().finish();
    Intent i=new Intent(CreateGroup.this,UserPage.class);
    i.putExtra("title11","dd");
    startActivity(i);
    finish();
}
Run Code Online (Sandbox Code Playgroud)

此方法未被调用,OnBackPresssed每次按后退按钮时都会调用默认值.

android

7
推荐指数
2
解决办法
1万
查看次数

jquery点击不使用css'position:fixed'属性

当我删除这个属性它工作正常,为什么会这样?

这是jquery函数:

 $(document).ready(function(){
 $('#flogo').click(function(){

   window.alert("clicked");

})
});
Run Code Online (Sandbox Code Playgroud)

这是Html代码:

<div id="fblike" class="fixedlogo"><img src="images/likelogo.png" id="flogo" />    </div>
Run Code Online (Sandbox Code Playgroud)

这是css:

 .fixedlogo
{
position: fixed; //If i remove this line then jquery is working.
height:50px;
margin-top: -20px;
}
Run Code Online (Sandbox Code Playgroud)

html css jquery

7
推荐指数
1
解决办法
5384
查看次数

Android 上的蓝牙:StartDiscovery 不起作用。无法扫描设备

我是 android 新手,我正在制作一个具有蓝牙功能的应用程序。我可以设置蓝牙适配器,获取我自己的设备信息,但我无法使用 startdiscovery 来发现蓝牙设备。当我开始扫描时,它什么也不做。

我正在使用 onclicklistner 开始扫描:

  bt.setOnClickListener(new OnClickListener() {
           @Override
           public void onClick(View v) {
               if (!(bluetooth.isEnabled())) {
                   status = "Bluetooth is not Enabled.";
                   Toast.makeText(AddUser.this, status, Toast.LENGTH_LONG).show();
                   Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
                startActivityForResult(enableBtIntent, 1);

                }
                else
                {

                    scand();
                }

           }
Run Code Online (Sandbox Code Playgroud)

这是我在“public void onCreate”函数之后放置的 onActivityResult 函数:

 protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
    System.out.println(resultCode);
    if (resultCode ==  RESULT_CANCELED) {
        status="Error Enabling bluetooth";
        Toast.makeText(AddUser.this, status, Toast.LENGTH_LONG).show();
    } else {

            scand();
    }



}
Run Code Online (Sandbox Code Playgroud)

这是我的扫描功能,我在其中调用 startdiscovery:

    private void scand()
{ …
Run Code Online (Sandbox Code Playgroud)

android bluetooth

2
推荐指数
1
解决办法
2万
查看次数

在aspx页面中显示DataTable信息

我是 Asp.net 新手。我创建了一个登录页面,用于检索数据表中的用户信息。我将此信息存储在会话变量中。

这是代码:

 using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data;
using System.Web.Configuration; 


public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}
protected void btnSubmit_Click(object sender, EventArgs e)
{
    SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["dbconnection"].ConnectionString);
    con.Open();
    SqlCommand cmd = new SqlCommand("select * from UserTable where UserName =@username and Password=@password", con);
    cmd.Parameters.AddWithValue("@username", txtUserName.Text);
    cmd.Parameters.AddWithValue("@password", txtPWD.Text);
    SqlDataAdapter da …
Run Code Online (Sandbox Code Playgroud)

c# asp.net datatable

0
推荐指数
1
解决办法
2万
查看次数

标签 统计

android ×2

asp.net ×1

bluetooth ×1

c# ×1

css ×1

datatable ×1

html ×1

jquery ×1