我打算用HTML/JAVASCRIPT/jQuery编程接口来控制电子设备.通信必须通过蓝牙(已经有一个指令集来控制存在的设备,并且该设备已经支持蓝牙),并且此接口应该可以通过Phonegap移植到Android应用程序...
所以我想知道如何建立与HTML或JAVASCRIPT的蓝牙通信,并通过Phonegap移植它...教程,书籍或任何类型的提示将热烈欢迎!
刚刚添加了一个新按钮到我已经工作正常的布局,但是findViewById函数似乎对我无法理解的东西感到生气.
这是一些布局:
<LinearLayout
...
>
<ListView
android:id="@+id/my_lovely_list"
android:layout_width="fill_parent"
android:layout_weight="1"
/>
<Button
android:id="@+id/my_lovely_butt"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/exit_b"
android:layout_weight="0"
android:clickable="true"
/>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
这里有一些编码:
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
...
list_o = (ListView)findViewById(R.id.my_lovely_list);
butt_o = (Button)findViewById(R.id.my_lovely_butt);
...
}
Run Code Online (Sandbox Code Playgroud)
所以,最大的错误是ListView被发现没有任何问题,但Button绝不会.我已经尝试过清理Proyect了,看看我在这里发现的帖子......但仍然没有找到问题!有什么想法吗?